Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Fork of VodafoneUSBModem by
Revision 40:9c6c87297a37, committed 2012-09-20
- Comitter:
- nherriot
- Date:
- Thu Sep 20 08:04:43 2012 +0000
- Parent:
- 38:d19354028042
- Parent:
- 39:85dc5ca10b7f
- Child:
- 41:8bec5a8ea878
- Child:
- 43:3071cf940880
- Commit message:
- merging of code.
Changed in this revision
--- a/sms/SMSInterface.cpp Wed Sep 19 15:33:13 2012 +0000
+++ b/sms/SMSInterface.cpp Thu Sep 20 08:04:43 2012 +0000
@@ -17,7 +17,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#define __DEBUG__ 0
+#define __DEBUG__ 4
#ifndef __MODULE__
#define __MODULE__ "SMSInterface.cpp"
#endif
@@ -119,7 +119,9 @@
m_inboxMtx.lock();
if(m_msgRefListCount == 0 && m_needsUpdate)
{
+ DBG("Message list count is 0 and needs updating. Running updateInbox.");
ret = updateInbox();
+
if (ret)
{
m_inboxMtx.unlock();
@@ -130,6 +132,7 @@
if(m_msgRefListCount == 0)
{
m_inboxMtx.unlock();
+ DBG("Message list count is 0, I think it's empty and returning.");
return NET_EMPTY; //No message to read
}
@@ -154,6 +157,7 @@
if (m_state != SMS_CMD_PROCESSED)
{
+ WARN(" State variable is not 'SMS_CMD_PROCESSED' - returning 'NET_EMPTY'");
m_state = SMS_IDLE;
m_inboxMtx.unlock();
return NET_EMPTY;
@@ -161,7 +165,7 @@
m_state = SMS_IDLE;
- DBG("Deleting message");
+ DBG("Deleting message from index number: d%", m_msgRefList[0] );
//Delete message from outbox
std::sprintf(cmd, "AT+CMGD=%d", m_msgRefList[0]);
ret = m_pIf->executeSimple(cmd, NULL, DEFAULT_TIMEOUT);
@@ -170,11 +174,12 @@
m_inboxMtx.unlock();
WARN("Could not delete message");
}
-
+ else
+ {
//Remove message from list
std::memmove(m_msgRefList, m_msgRefList+1, m_msgRefListCount-1);
m_msgRefListCount--;
-
+ }
m_inboxMtx.unlock();
return OK;
