Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Committer:
ashleymills
Date:
Thu Sep 06 14:28:01 2012 +0000
Revision:
26:9eefab9e28df
Parent:
25:55b865c41f21
Child:
27:0297dbc3252b
Started changing test framework to add dependencies.;

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 26:9eefab9e28df 4 static const char* gTest21Description = "Trying out USSD communication sending *#100#\0";
ashleymills 26:9eefab9e28df 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 };