Vodafone K3770/K3772-Z modems driver & networking library
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Dependents: VodafoneUSBModemHTTPClientTest VodafoneUSBModemNTPClientTest VodafoneUSBModemSMSTest VodafoneUSBModemUSSDTest ... more
Fork of VodafoneUSBModem_bleedingedge by
This is the driver for the Vodafone K3700 & K3772-Z Dongles:
More details and instructions can be found here.
Revision 28:c94ffb45a848, committed 2012-08-30
- Comitter:
- donatien
- Date:
- Thu Aug 30 10:48:35 2012 +0000
- Parent:
- 27:37d3ac289e86
- Child:
- 29:870de7db2ccb
- Commit message:
- Fixed SMS dropped "REC READ" messages issue
Changed in this revision
sms/SMSInterface.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/sms/SMSInterface.cpp Thu Aug 30 09:16:05 2012 +0000 +++ b/sms/SMSInterface.cpp Thu Aug 30 10:48:35 2012 +0000 @@ -233,7 +233,7 @@ { DBG("Header: %s", line); int msgRef; - if( std::sscanf(line, "+CMGL: %d", &msgRef) == 1 ) + if( std::sscanf(line, "+CMGL: %d,\"REC", &msgRef) == 1 ) //Filter on REC READ and REC UNREAD messages { m_state = SMS_GET_COUNT_HDR_RECEIVED; //Add message to list @@ -355,12 +355,25 @@ int SMSInterface::updateInbox() { //Get memory indexes of unread messages - m_state = SMS_GET_COUNT_CMD_SENT; DBG("Updating inbox"); m_msgRefListCount = 0; //Reset list - int ret = m_pIf->execute("AT+CMGL=\"REC UNREAD\"", this, NULL, DEFAULT_TIMEOUT); + //First list the "REC READ" messages that were not processed in the previous session + m_state = SMS_GET_COUNT_CMD_SENT; + int ret = m_pIf->execute("AT+CMGL=\"REC READ\"", this, NULL, DEFAULT_TIMEOUT); + if( ret != OK ) + { + WARN("AT+CMGL returned %d", ret); + m_state = SMS_IDLE; + m_msgRefListCount = 0; //List could be invalid + m_needsUpdate = true; + return NET_PROTOCOL; + } + + //Now list the "REC UNREAD" messages that were received modem since + m_state = SMS_GET_COUNT_CMD_SENT; + ret = m_pIf->execute("AT+CMGL=\"REC UNREAD\"", this, NULL, DEFAULT_TIMEOUT); if( ret != OK ) { WARN("AT+CMGL returned %d", ret);