Two bug fixes: TCPsend argument type, and missing end-of-buffer check #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changed argument type of TCPsend from char * to uint8_t *. Without this change, compilation failed on type incompatibility in the arduino.cc IDE version 2:1.0.5+dfsg2-4 (as distributed with Debian Jessie), when compiling for Arduino UNO. I guess the incompatibility is because of the signed/unsigned difference.
Moved the end-of-buffer check from the outer loop to the inner loop in readline(): this is necessary, because the inner loop is capable of traversing through the buffer. Also, use sizeof() to determine the end of buffer, like in readRaw().
Tested superficially by compiling and running this together with my own sketch code. I verified that this compiles without warnings, and I can communicate with my FONA (fona.begin() and fona.unlockSIM() are successful).