PHS module SMA-01 library. see: https://developer.mbed.org/users/phsfan/notebook/abitusbmodem/
Dependencies: Socket lwip-sys lwip
Dependents: AbitUSBModem_HTTPTest AbitUSBModem_MQTTTest AbitUSBModem_WebsocketTest AbitUSBModem_SMSTest
Fork of VodafoneUSBModem by
Diff: sms/SMSInterface.cpp
- Revision:
- 91:7b311719374d
- Parent:
- 83:897a0de9d668
--- a/sms/SMSInterface.cpp Thu Jun 27 12:16:30 2013 +0000 +++ b/sms/SMSInterface.cpp Fri Sep 20 10:40:58 2013 +0000 @@ -103,6 +103,8 @@ } DBG("SM sent"); + // since unsolicited events are blocked during send SM events,it makes sense to update the mailbox + m_needsUpdate = true; m_state = SMS_IDLE; return OK; } @@ -281,7 +283,7 @@ { int crPos = crPtr - m_msg; //Replace m_inputBuf[crPos] with null-terminating char - m_msg[crPos] = '\x0'; + m_msg[crPos] = '\0'; //If there is a CR char, split message there @@ -363,7 +365,8 @@ //Get index int msgRef; - if( std::sscanf(evt, "\"SM\",%d", &msgRef) == 1 ) + if(( std::sscanf(evt, "\"SM\",%d", &msgRef) == 1 ) || + ( std::sscanf(evt, "\"ME\",%d", &msgRef) == 1 )) // ublox modules preferentially use ME for storage { DBG("Adding message to list (ref %d)", msgRef); if(m_inboxMtx.trylock())