Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Committer:
ashleymills
Date:
Thu Sep 06 13:35:25 2012 +0000
Revision:
25:55b865c41f21
Parent:
19:26fbed33d4e7
Child:
26:9eefab9e28df
Added descriptions for each test.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ashleymills 3:28336c2e94e4 1 #pragma once
ashleymills 3:28336c2e94e4 2 #include "VodafoneTestCase.h"
ashleymills 25:55b865c41f21 3
ashleymills 25:55b865c41f21 4 static const char* gTest21Description = "Ttrying out USSD communication sending *#100#\0";
ashleymills 25:55b865c41f21 5
ashleymills 19:26fbed33d4e7 6 class Test21 : public VodafoneTestCase {
ashleymills 3:28336c2e94e4 7 public:
ashleymills 19:26fbed33d4e7 8 Test21(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) {
ashleymills 3:28336c2e94e4 9 }
ashleymills 8:6c30647f75d7 10
ashleymills 8:6c30647f75d7 11 virtual void setupTest() {
ashleymills 8:6c30647f75d7 12 _ussdResponse = (char*)malloc(16*sizeof(char));
ashleymills 8:6c30647f75d7 13 }
ashleymills 3:28336c2e94e4 14
ashleymills 3:28336c2e94e4 15 virtual bool runTest() {
ashleymills 25:55b865c41f21 16 LOG(gTest21Description);
ashleymills 4:1f8e079924ba 17
ashleymills 8:6c30647f75d7 18 if(_modem->sendUSSD("*#100#",_ussdResponse,16)!=0) {
ashleymills 3:28336c2e94e4 19 LOG("Error sending USSD");
ashleymills 3:28336c2e94e4 20 return false;
ashleymills 3:28336c2e94e4 21 }
ashleymills 3:28336c2e94e4 22
ashleymills 8:6c30647f75d7 23 LOG("Received USSD response: \"%s\"",_ussdResponse);
ashleymills 3:28336c2e94e4 24 return true;
ashleymills 3:28336c2e94e4 25 }
ashleymills 8:6c30647f75d7 26
ashleymills 8:6c30647f75d7 27 virtual void endTest() {
ashleymills 8:6c30647f75d7 28 free(_ussdResponse);
ashleymills 8:6c30647f75d7 29 }
ashleymills 8:6c30647f75d7 30
ashleymills 8:6c30647f75d7 31 private:
ashleymills 8:6c30647f75d7 32 char *_ussdResponse;
ashleymills 8:6c30647f75d7 33 };