Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Revision:
20:18373fb68ad7
Child:
25:55b865c41f21
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tests/Test23.cpp	Tue Sep 04 15:31:55 2012 +0000
@@ -0,0 +1,31 @@
+#pragma once
+#include "Test23.h"
+
+const char *Test23Description = "Test %d sending USSD over 150 chars \"0(0)00 ... 000(160)\"\0";
+const char *Test23USSDMessage = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\0";
+
+Test23::Test23(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) { }
+      
+// virtual
+void Test23::setupTest() {
+   _ussdResponse = (char*)malloc(16*sizeof(char));
+}
+   
+// virtual
+bool Test23::runTest() {
+
+   LOG(Test23Description, _testCaseNumber);
+         
+   if(_modem->sendUSSD(Test23USSDMessage,_ussdResponse,16)!=0) {
+      LOG("Error sending USSD");
+      return false;
+   }
+         
+   LOG("Expecting \"Unknown Command\". Received USSD response: \"%s\"",_ussdResponse);
+   return (strcmp(_ussdResponse,"Unknown command")==0);
+}
+      
+// virtual
+void Test23::endTest() {
+   free(_ussdResponse);
+}
\ No newline at end of file