Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Diff: Tests/Test13.h
- Revision:
- 30:dd2beda340c6
- Parent:
- 27:0297dbc3252b
- Parent:
- 29:c0e6f198db84
- Child:
- 31:9231acdde9ff
diff -r 0297dbc3252b -r dd2beda340c6 Tests/Test13.h --- a/Tests/Test13.h Thu Sep 06 15:13:38 2012 +0000 +++ b/Tests/Test13.h Wed Sep 12 10:18:28 2012 +0000 @@ -1,67 +1,63 @@ -#pragma once -#include "VodafoneTestCase.h" - -#define TEST_PHONE_NUMBER "+447717275049" - -// this test case will wait to receive an SMS from the modem. -// if the method that reports a message waiting returns an error it will fail. -// if the method that returns the message from the mailbox returns an error it will fai. -// it will report the test as failed if any of the above happens. -// it waits forever for an SMS. -// TODO: this should wait for a set time before failing. - -static const char *gTest13Description = "Waiting for an SMS message..."; -//const int gTest13Depends[] = {}; - -class Test13 : public VodafoneTestCase { - public: - - char num[17]; - char msg[64]; - size_t count; - - - Test13(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { - } - - virtual bool runTest() { - LOG("Test %d waiting for an SMS message...", _testCaseNumber); - LOG("Receiving SMS from test phone, waiting for response."); - - while(true) - { - LOG("Waiting for an SMS message..."); - int ret = _modem->getSMCount(&count); - if(ret) - { - LOG("getSMCount returned %d", ret); - Thread::wait(3000); - continue; - } - - if( count > 0) - { - LOG("%d SMS to read", count); - ret = _modem->getSM(num, msg, 64); - if(ret) - { - LOG("Error receiving sms. The method getSMS returned %d", ret); - return false; - } - LOG("The message is from number: %s and the message is: \"%s\"", num, msg); - return true; - } - Thread::wait(500); - } - - } - - private: - char gsm03dot38CharacterSet[127]; - // gsm03dot38CharacterSet="@£$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !“#¤%&‘()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà"; - - - - - +#pragma once +#include "VodafoneTestCase.h" + +#define TEST_PHONE_NUMBER "+447717275049" + +// this test case will wait to receive an SMS from the modem. +// if the method that reports a message waiting returns an error it will fail. +// if the method that returns the message from the mailbox returns an error it will fai. +// it will report the test as failed if any of the above happens. +// it waits forever for an SMS. +// TODO: this should wait for a set time before failing. + +static const char *gTest13Description = "Waiting for an SMS message..."; +//const int gTest13Depends[] = {}; + +class Test13 : public VodafoneTestCase { + public: + + char num[17]; + char msg[64]; + size_t count; + + + Test13(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { + } + + virtual bool runTest() { + LOG("Test %d waiting for an SMS message...", _testCaseNumber); + LOG("Receiving SMS from test phone, waiting for response."); + + while(true) + { + LOG("Waiting for an SMS message..."); + int ret = _modem->getSMCount(&count); + if(ret) + { + LOG("getSMCount returned %d", ret); + Thread::wait(3000); + continue; + } + + if( count > 0) + { + LOG("%d SMS to read", count); + ret = _modem->getSM(num, msg, 64); + if(ret) + { + LOG("Error receiving sms. The method getSMS returned %d", ret); + return false; + } + LOG("The message is from number: %s and the message is: \"%s\"", num, msg); + return true; + } + Thread::wait(500); + } + + } + + private: + char gsm03dot38CharacterSet[127]; + // gsm03dot38CharacterSet="@£$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !“#¤%&‘()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà"; + }; \ No newline at end of file