Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test06.h@74:e52ac9624f7f, 2014-01-29 (annotated)
- Committer:
- ashleymills
- Date:
- Wed Jan 29 16:34:38 2014 +0000
- Revision:
- 74:e52ac9624f7f
- Parent:
- 66:6b00a764e549
Updated dependencies to latest versions.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 66:6b00a764e549 | 1 | #pragma once |
ashleymills | 66:6b00a764e549 | 2 | #include "VodafoneTestCase.h" |
ashleymills | 66:6b00a764e549 | 3 | |
ashleymills | 66:6b00a764e549 | 4 | extern const char* gTest06Description; |
ashleymills | 66:6b00a764e549 | 5 | //const int gTest06Depends[] = {}; |
ashleymills | 66:6b00a764e549 | 6 | |
ashleymills | 66:6b00a764e549 | 7 | class Test06 : public VodafoneTestCase { |
ashleymills | 66:6b00a764e549 | 8 | public: |
ashleymills | 66:6b00a764e549 | 9 | Test06(VodafoneUSBModem *m) : VodafoneTestCase(m) {} |
ashleymills | 66:6b00a764e549 | 10 | |
ashleymills | 66:6b00a764e549 | 11 | private: |
ashleymills | 66:6b00a764e549 | 12 | |
ashleymills | 66:6b00a764e549 | 13 | virtual void setupTest() { |
ashleymills | 66:6b00a764e549 | 14 | _ussdResponse = (char*)malloc(16*sizeof(char)); |
ashleymills | 66:6b00a764e549 | 15 | } |
ashleymills | 66:6b00a764e549 | 16 | |
ashleymills | 66:6b00a764e549 | 17 | virtual bool executeTest() { |
ashleymills | 66:6b00a764e549 | 18 | LOG(gTest06Description); |
ashleymills | 66:6b00a764e549 | 19 | |
ashleymills | 66:6b00a764e549 | 20 | if(_modem->sendUSSD("*#100#",_ussdResponse,16)!=0) { |
ashleymills | 66:6b00a764e549 | 21 | LOG("Error sending USSD"); |
ashleymills | 66:6b00a764e549 | 22 | return false; |
ashleymills | 66:6b00a764e549 | 23 | } |
ashleymills | 66:6b00a764e549 | 24 | |
ashleymills | 66:6b00a764e549 | 25 | LOG("Received USSD response: \"%s\"",_ussdResponse); |
ashleymills | 66:6b00a764e549 | 26 | return true; |
ashleymills | 66:6b00a764e549 | 27 | } |
ashleymills | 66:6b00a764e549 | 28 | |
ashleymills | 66:6b00a764e549 | 29 | virtual void endTest() { |
ashleymills | 66:6b00a764e549 | 30 | free(_ussdResponse); |
ashleymills | 66:6b00a764e549 | 31 | } |
ashleymills | 66:6b00a764e549 | 32 | |
ashleymills | 66:6b00a764e549 | 33 | char *_ussdResponse; |
ashleymills | 66:6b00a764e549 | 34 | }; |