Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test21.h@27:0297dbc3252b, 2012-09-06 (annotated)
- Committer:
- ashleymills
- Date:
- Thu Sep 06 15:13:38 2012 +0000
- Revision:
- 27:0297dbc3252b
- Parent:
- 26:9eefab9e28df
- Child:
- 33:16126e029d58
Commended out dependency stuff. TestManager now prints numbers and descriptions of failed tests.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 3:28336c2e94e4 | 1 | #pragma once |
ashleymills | 3:28336c2e94e4 | 2 | #include "VodafoneTestCase.h" |
ashleymills | 25:55b865c41f21 | 3 | |
ashleymills | 27:0297dbc3252b | 4 | static const char* gTest21Description = "Trying out USSD communication sending *#100#"; |
ashleymills | 27:0297dbc3252b | 5 | //const int gTest21Depends[] = {}; |
ashleymills | 25:55b865c41f21 | 6 | |
ashleymills | 19:26fbed33d4e7 | 7 | class Test21 : public VodafoneTestCase { |
ashleymills | 3:28336c2e94e4 | 8 | public: |
ashleymills | 19:26fbed33d4e7 | 9 | Test21(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { |
ashleymills | 3:28336c2e94e4 | 10 | } |
ashleymills | 8:6c30647f75d7 | 11 | |
ashleymills | 8:6c30647f75d7 | 12 | virtual void setupTest() { |
ashleymills | 8:6c30647f75d7 | 13 | _ussdResponse = (char*)malloc(16*sizeof(char)); |
ashleymills | 8:6c30647f75d7 | 14 | } |
ashleymills | 3:28336c2e94e4 | 15 | |
ashleymills | 3:28336c2e94e4 | 16 | virtual bool runTest() { |
ashleymills | 25:55b865c41f21 | 17 | LOG(gTest21Description); |
ashleymills | 4:1f8e079924ba | 18 | |
ashleymills | 8:6c30647f75d7 | 19 | if(_modem->sendUSSD("*#100#",_ussdResponse,16)!=0) { |
ashleymills | 3:28336c2e94e4 | 20 | LOG("Error sending USSD"); |
ashleymills | 3:28336c2e94e4 | 21 | return false; |
ashleymills | 3:28336c2e94e4 | 22 | } |
ashleymills | 3:28336c2e94e4 | 23 | |
ashleymills | 8:6c30647f75d7 | 24 | LOG("Received USSD response: \"%s\"",_ussdResponse); |
ashleymills | 3:28336c2e94e4 | 25 | return true; |
ashleymills | 3:28336c2e94e4 | 26 | } |
ashleymills | 8:6c30647f75d7 | 27 | |
ashleymills | 8:6c30647f75d7 | 28 | virtual void endTest() { |
ashleymills | 8:6c30647f75d7 | 29 | free(_ussdResponse); |
ashleymills | 8:6c30647f75d7 | 30 | } |
ashleymills | 8:6c30647f75d7 | 31 | |
ashleymills | 8:6c30647f75d7 | 32 | private: |
ashleymills | 8:6c30647f75d7 | 33 | char *_ussdResponse; |
ashleymills | 8:6c30647f75d7 | 34 | }; |