Skip to content

read() and write() do not behave as documented #2

Open
@mfiore02

Description

@mfiore02

read() and write() do not behave as documented in ATParser.h.

/**
* Write an array of bytes to the underlying stream
*
* @param data the array of bytes to write
* @param size number of bytes to write
* @return number of bytes written or -1 on failure
*/
int write(const char *data, int size);

/**
* Read an array of bytes from the underlying stream
*
* @param data the destination for the read bytes
* @param size number of bytes to read
* @return number of bytes read or -1 on failure
*/
int read(char *data, int size);

Existing implementation will error out if bytes read/written do not exactly match size parameter.

Activity

added a commit that references this issue on Jun 30, 2017

Merge pull request ARMmbed#2 from c1728p9/nsapi_update

geky

geky commented on Jul 27, 2017

@geky
Contributor

Hi @mfiore02, thanks for the issue andpr to fix this. One of us should have responded a long time ago.

Unfortunately, this repo is used in quite a few places, so backwards compatibility is very important at the moment. I agree that the behaviour isn't intuitive and should be changed to match the API that is normally expected (and even documented), but changing this API may break quite a few dependencies.

So we've been hesitant to merge this change until we are in a place where we can break a few APIs. I haven't checked, but this may have already ended up in the ATCmdParser fork, and should be included in any new majore revisions of the driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @geky@mfiore02

      Issue actions

        read() and write() do not behave as documented · Issue #2 · ARMmbed/ATParser