Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Tests/Test06.h

Committer:
ashleymills
Date:
2014-01-29
Revision:
74:e52ac9624f7f
Parent:
66:6b00a764e549

File content as of revision 74:e52ac9624f7f:

#pragma once
#include "VodafoneTestCase.h"

extern const char* gTest06Description;
//const int gTest06Depends[] = {};

class Test06 : public VodafoneTestCase {
   public: 
      Test06(VodafoneUSBModem *m) : VodafoneTestCase(m) {}
      
   private:
   
      virtual void setupTest() {
         _ussdResponse = (char*)malloc(16*sizeof(char));
      }
   
      virtual bool executeTest() {
         LOG(gTest06Description);
         
         if(_modem->sendUSSD("*#100#",_ussdResponse,16)!=0) {
            LOG("Error sending USSD");
            return false;
         }
         
         LOG("Received USSD response: \"%s\"",_ussdResponse);
         return true;
      }
      
      virtual void endTest() {
         free(_ussdResponse);
      }
      
      char *_ussdResponse;
};