Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test21.h@43:6db6a72d722b, 2012-09-14 (annotated)
- Committer:
- donatien
- Date:
- Fri Sep 14 15:14:29 2012 +0000
- Revision:
- 43:6db6a72d722b
- Parent:
- 42:e423e7204e5c
- Child:
- 44:6d0ac4747f5b
Removed debugging info
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 | 37:847f5f86e9ff | 4 | extern const char* gTest21Description; |
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 | 33:16126e029d58 | 9 | Test21(VodafoneUSBModem *m) : VodafoneTestCase(m) { |
ashleymills | 33:16126e029d58 | 10 | _description = gTest21Description; |
ashleymills | 33:16126e029d58 | 11 | _testCaseNumber = 21; |
ashleymills | 3:28336c2e94e4 | 12 | } |
ashleymills | 8:6c30647f75d7 | 13 | |
ashleymills | 8:6c30647f75d7 | 14 | virtual void setupTest() { |
ashleymills | 8:6c30647f75d7 | 15 | _ussdResponse = (char*)malloc(16*sizeof(char)); |
ashleymills | 8:6c30647f75d7 | 16 | } |
ashleymills | 3:28336c2e94e4 | 17 | |
ashleymills | 34:d9e45aad85f2 | 18 | virtual bool execute() { |
ashleymills | 37:847f5f86e9ff | 19 | LOG(_description); |
ashleymills | 4:1f8e079924ba | 20 | |
ashleymills | 8:6c30647f75d7 | 21 | if(_modem->sendUSSD("*#100#",_ussdResponse,16)!=0) { |
ashleymills | 3:28336c2e94e4 | 22 | LOG("Error sending USSD"); |
ashleymills | 3:28336c2e94e4 | 23 | return false; |
ashleymills | 3:28336c2e94e4 | 24 | } |
ashleymills | 3:28336c2e94e4 | 25 | |
ashleymills | 8:6c30647f75d7 | 26 | LOG("Received USSD response: \"%s\"",_ussdResponse); |
ashleymills | 3:28336c2e94e4 | 27 | return true; |
ashleymills | 3:28336c2e94e4 | 28 | } |
ashleymills | 8:6c30647f75d7 | 29 | |
ashleymills | 8:6c30647f75d7 | 30 | virtual void endTest() { |
ashleymills | 8:6c30647f75d7 | 31 | free(_ussdResponse); |
ashleymills | 8:6c30647f75d7 | 32 | } |
ashleymills | 8:6c30647f75d7 | 33 | |
ashleymills | 8:6c30647f75d7 | 34 | private: |
ashleymills | 8:6c30647f75d7 | 35 | char *_ussdResponse; |
ashleymills | 8:6c30647f75d7 | 36 | }; |