Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test21.h@19:26fbed33d4e7, 2012-09-03 (annotated)
- Committer:
- ashleymills
- Date:
- Mon Sep 03 16:02:58 2012 +0000
- Revision:
- 19:26fbed33d4e7
- Parent:
- Tests/Test20.h@17:28443b768f1c
- Child:
- 25:55b865c41f21
Added another USSD test. Changed the framework so a list of tests is passed to the execution function.
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 | 19:26fbed33d4e7 | 3 | class Test21 : public VodafoneTestCase { |
ashleymills | 3:28336c2e94e4 | 4 | public: |
ashleymills | 19:26fbed33d4e7 | 5 | Test21(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { |
ashleymills | 3:28336c2e94e4 | 6 | } |
ashleymills | 8:6c30647f75d7 | 7 | |
ashleymills | 8:6c30647f75d7 | 8 | virtual void setupTest() { |
ashleymills | 8:6c30647f75d7 | 9 | _ussdResponse = (char*)malloc(16*sizeof(char)); |
ashleymills | 8:6c30647f75d7 | 10 | } |
ashleymills | 3:28336c2e94e4 | 11 | |
ashleymills | 3:28336c2e94e4 | 12 | virtual bool runTest() { |
nherriot | 17:28443b768f1c | 13 | |
nherriot | 17:28443b768f1c | 14 | LOG("Test %d trying out USSD communication sending *#100#", _testCaseNumber); |
ashleymills | 4:1f8e079924ba | 15 | |
ashleymills | 8:6c30647f75d7 | 16 | if(_modem->sendUSSD("*#100#",_ussdResponse,16)!=0) { |
ashleymills | 3:28336c2e94e4 | 17 | LOG("Error sending USSD"); |
ashleymills | 3:28336c2e94e4 | 18 | return false; |
ashleymills | 3:28336c2e94e4 | 19 | } |
ashleymills | 3:28336c2e94e4 | 20 | |
ashleymills | 8:6c30647f75d7 | 21 | LOG("Received USSD response: \"%s\"",_ussdResponse); |
ashleymills | 3:28336c2e94e4 | 22 | return true; |
ashleymills | 3:28336c2e94e4 | 23 | } |
ashleymills | 8:6c30647f75d7 | 24 | |
ashleymills | 8:6c30647f75d7 | 25 | virtual void endTest() { |
ashleymills | 8:6c30647f75d7 | 26 | free(_ussdResponse); |
ashleymills | 8:6c30647f75d7 | 27 | } |
ashleymills | 8:6c30647f75d7 | 28 | |
ashleymills | 8:6c30647f75d7 | 29 | private: |
ashleymills | 8:6c30647f75d7 | 30 | char *_ussdResponse; |
ashleymills | 8:6c30647f75d7 | 31 | }; |