Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Diff: Tests/Test16.h
- Revision:
- 28:c630a04a7198
- Child:
- 29:c0e6f198db84
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Tests/Test16.h Mon Sep 10 04:59:11 2012 +0000 @@ -0,0 +1,46 @@ +#pragma once +#include "VodafoneTestCase.h" +//#define __DEBUG__ 1 + +// this test case will wait to send an SMS from the modem. +// if the method that sends a message returns an error it will fail. +// it will report the test as failed if any of the above happens. +// it does not wait after it has succesfully sent an SMS. + + +class Test16 : public VodafoneTestCase { + public: + + + Test16(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { + } + + virtual bool runTest() { + LOG("Creating GSM test buffer"); + LOG("Test %d sending an SMS message...", _testCaseNumber); + LOG("Sending SMS:' %s ' to test phone: %s , waiting for response.", testMessage, testPhoneNumber); + + int ret = _modem->sendSM(testPhoneNumber, testMessage); + + if (ret) + { + LOG("Error in sending the SMS message. The return values is: %d", ret); + + switch(ret){ + case(NET_INVALID): LOG("Error message is: 'phone number is invalid size, must be less than 16 digits'.");break; + case(NET_PROTOCOL): LOG("Error message is: 'protocol error from the modem'.");break; + default: LOG("Undefined error message."); + + } + return false; + } + LOG("Test %d passed...", _testCaseNumber); + return true; + + } + + private: + char gsm03dot38CharacterSet[127]; + + +}; \ No newline at end of file