Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

GSMClient::read() returns 0 rather than -1 if there's no data available #4

Open
agdl opened this issue Jul 12, 2016 · 0 comments
Open
Assignees

Comments

@agdl
Copy link
Member

agdl commented Jul 12, 2016

From @amcewen on August 16, 2015 17:26

Part of the problem is the line https://github.com/arduino/Arduino/blob/master/libraries/GSM/src/GSM3ShieldV1ClientProvider.cpp#L248, which returns 0 when there's no data available.

However, there's also (from code inspection) a problem in the multi-byte version of GSMClient::read because that also assumes that read() returning 0 indicates no data left.

And the problem propagates all the way down to GSM3CircularBuffer::read which also returns 0 if there's no data available.

The problem there is that GSM3CircularBuffer::read returns a char, so there's nowhere that an error can be signalled, so presumably it would need to be reworked to return an int instead.

Copied from original issue: arduino/Arduino#3690

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants