Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Committer:
ashleymills
Date:
Fri Aug 24 10:35:19 2012 +0000
Revision:
8:6c30647f75d7
Parent:
4:1f8e079924ba
Child:
13:8b69853966f8
Improved the framework so that it automatically logs test times and outcomes.

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 3:28336c2e94e4 3 class Test20 : public VodafoneTestCase {
ashleymills 3:28336c2e94e4 4 public:
ashleymills 3:28336c2e94e4 5 Test20(VodafoneUSBModem *m) : VodafoneTestCase(m) {
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() {
ashleymills 8:6c30647f75d7 13
ashleymills 3:28336c2e94e4 14 LOG("Sending USSD, waiting for response.");
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 };