Adafruit_FONA
Adafruit_FONA copied to clipboard
Two bug fixes: TCPsend argument type, and missing end-of-buffer check
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).