Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Diff: Tests/Test11.h
- Revision:
- 72:0e8e769fcf76
- Parent:
- 69:4fc3b0ad12c7
--- a/Tests/Test11.h Thu Jun 27 13:09:14 2013 +0000 +++ b/Tests/Test11.h Fri Sep 20 12:36:03 2013 +0000 @@ -60,16 +60,28 @@ LOG("Artificially waiting for 2 seconds"); Thread::wait(2000); LOG("Attempting to send SMS %d of %d",i+1,numIterations); - if(_modem->sendSM(_ownNumber,_smsOut)!=0) { + int tries = 3; + int sent = 0; + while(tries--) { + if(_modem->sendSM(_ownNumber,_smsOut)==0) { + sent = 1; + break; + } LOG("Error sending short message"); } - LOG("Sent: %s",_smsOut); + if(!sent) { + LOG("Failure to send SMS after 3 tries, aborting."); + return false; + } else { + LOG("Sent: %s",_smsOut); + } + bool gotMessage = false; Timer t; t.start(); - int msToWait = 10000; + int msToWait = 60000; LOG("Waiting %d seconds for response",msToWait/1000); while(!gotMessage && t.read_ms()<msToWait) { if(_modem->getSMCount(&smCount)!=0) {