Version working with mbed-os
Fork of Adafruit_FONA_Library by
Diff: Adafruit_FONA.cpp
- Revision:
- 6:b675eab1c47a
- Parent:
- 4:d8d3c9a5b2d5
- Child:
- 8:aacbc647caee
diff -r e376f5ebb49d -r b675eab1c47a Adafruit_FONA.cpp --- a/Adafruit_FONA.cpp Thu Dec 01 07:50:15 2016 +0000 +++ b/Adafruit_FONA.cpp Thu Jan 26 14:25:16 2017 +0000 @@ -26,7 +26,7 @@ bool Adafruit_FONA::begin(int baudrate) { mySerial.baud(baudrate); - mySerial.attach(callback(this, &Adafruit_FONA::onSerialDataReceived), Serial::RxIrq); + mySerial.attach(this, &Adafruit_FONA::onSerialDataReceived, Serial::RxIrq); _rstpin = HIGH; wait_ms(10); @@ -349,7 +349,7 @@ bool Adafruit_FONA::callerIdNotification(bool enable) { if(enable){ - _ringIndicatorInterruptIn.fall(callback(this, &Adafruit_FONA::onIncomingCall)); + _ringIndicatorInterruptIn.fall(this, &Adafruit_FONA::onIncomingCall); return sendCheckReply("AT+CLIP=1", "OK"); } @@ -464,8 +464,8 @@ bool Adafruit_FONA::sendSMS(char *smsaddr, char *smsmsg) { if (! sendCheckReply("AT+CMGF=1", "OK")) return -1; - char sendcmd[30] = "AT+CMGS=\""; - strncpy(sendcmd+9, smsaddr, 30-9-2); // 9 bytes beginning, 2 bytes for close quote + null + char sendcmd[15] = "AT+CMGS=\""; + strncpy(sendcmd+9, smsaddr, 15-9-2); // 9 bytes beginning, 2 bytes for close quote + null sendcmd[strlen(sendcmd)] = '\"'; if (! sendCheckReply(sendcmd, "> ")) return false;