Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

Files at this revision

API Documentation at this revision

Comitter:
ashleymills
Date:
Tue Mar 05 14:59:24 2013 +0000
Parent:
68:2f3ead00ab0a
Child:
70:619a2da3e40d
Commit message:
Now contains MU509 support.

Changed in this revision

Tests/Test00.cpp Show annotated file Show diff for this revision Revisions of this file
Tests/Test01.cpp Show annotated file Show diff for this revision Revisions of this file
Tests/Test11.h Show annotated file Show diff for this revision Revisions of this file
Tests/Test14.h Show annotated file Show diff for this revision Revisions of this file
Tests/TestHelper.h Show annotated file Show diff for this revision Revisions of this file
VodafoneTestCase.h Show annotated file Show diff for this revision Revisions of this file
VodafoneUSBModem_bleedingedge.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/Tests/Test00.cpp	Tue Dec 18 13:57:14 2012 +0000
+++ b/Tests/Test00.cpp	Tue Mar 05 14:59:24 2013 +0000
@@ -28,7 +28,7 @@
    bool outcome = true;
    LOG("Description: %s",gTest00Description);
    LOG("Connecting to internet");
-   if(_modem->connect("internet","web","web")==0) {
+   if(_modem->connect(APN,APN_USERNAME,APN_PASSWORD)==0) {
       LOG("Connected to internet");
    } else {
       LOG("Failed to connect to internet");
--- a/Tests/Test01.cpp	Tue Dec 18 13:57:14 2012 +0000
+++ b/Tests/Test01.cpp	Tue Mar 05 14:59:24 2013 +0000
@@ -1,4 +1,5 @@
 #include "Test01.h"
+#include "TestHelper.h"
 
 class HTTPFileValidator : public IHTTPDataIn {
 public:
@@ -62,7 +63,7 @@
    bool outcome = true;
    LOG("Description: %s",gTest01Description);
    LOG("Connecting to internet");
-   if(_modem->connect("internet","web","web")==0) {
+   if(_modem->connect(APN,APN_USERNAME,APN_PASSWORD)==0) {
       LOG("Connected to internet");
    } else {
       LOG("Failed to connect to internet");
--- a/Tests/Test11.h	Tue Dec 18 13:57:14 2012 +0000
+++ b/Tests/Test11.h	Tue Mar 05 14:59:24 2013 +0000
@@ -29,6 +29,7 @@
          // Clear out the SMS mail box before we run this test.
          // loop 3 times with a 1/2 second break in between each
          LOG("... Clearing out SMS mail box first");
+         bool smsCleared = false;
          for(int j=0; j<3; j++) {
             if(_modem->getSMCount(&smCount)!=0) {
                LOG("Failure getting SM count");
@@ -42,25 +43,37 @@
                }
                LOG("Got SMS: %s",_smsJunkBuffer);
                LOG("Clearing that out before running the test.");
+               smsCleared = true;
             }
             Thread::wait(500);
          }
+         if(!smsCleared) {
+            LOG("Nothing found to clear out.");
+         }
 
          LOG("Getting MSISDN");
          _modem->sendUSSD("*#100#",_ownNumber,_numberLen);
          LOG("Got  MSISDN %s",_ownNumber);
          for(int i=0; i<numIterations; i++) {
             createRandomString(_smsOut,_smsLen);
+            
+            LOG("Artificially waiting for 2 seconds");
+            Thread::wait(2000);
+            LOG("Attempting to send SMS %d of %d",i+1,numIterations);
             if(_modem->sendSM(_ownNumber,_smsOut)!=0) {
                LOG("Error sending short message");
             }
-            LOG("Created: %s",_smsOut);
+            
+            LOG("Sent: %s",_smsOut);
+            
             bool gotMessage = false;
             Timer t;
             t.start();
-            while(!gotMessage && t.read_ms()<25000) {
+            int msToWait = 10000;
+            LOG("Waiting %d seconds for response",msToWait/1000);
+            while(!gotMessage && t.read_ms()<msToWait) {
                if(_modem->getSMCount(&smCount)!=0) {
-                  LOG("Faiure getting SM count");
+                  LOG("Failure getting SM count");
                   return false;
                }
                
@@ -69,7 +82,7 @@
                      LOG("Failure getting SM");
                      return false;
                   }
-                  LOG("Got SMS: %s",_smsIn);
+                  LOG("Got SMS: %s after %f seconds.",_smsIn,t.read_ms()/1000.0);
                   if(strcmp(_smsIn,_smsOut)!=0) {
                      LOG("FAIL: strings did not match");
                      return false;
--- a/Tests/Test14.h	Tue Dec 18 13:57:14 2012 +0000
+++ b/Tests/Test14.h	Tue Mar 05 14:59:24 2013 +0000
@@ -22,7 +22,7 @@
          
          LOG("Description: %s",gTest14Description);
          LOG("Connecting to internet");
-         if(_modem->connect("internet","web","web")==0) {
+         if(_modem->connect(APN,APN_USERNAME,APN_PASSWORD)==0) {
             LOG("Connected to internet");
          } else {
             LOG("Failed to connect to internet");
--- a/Tests/TestHelper.h	Tue Dec 18 13:57:14 2012 +0000
+++ b/Tests/TestHelper.h	Tue Mar 05 14:59:24 2013 +0000
@@ -1,2 +1,12 @@
-#pragma once
-bool connectToSocket(char *ipAddress, int port, int *sockfd);
\ No newline at end of file
+#pragma once
+bool connectToSocket(char *ipAddress, int port, int *sockfd);
+//#define GDSP
+#ifdef GDSP
+#define APN "ppinternetd.gdsp" 
+#define APN_USERNAME ""
+#define APN_PASSWORD ""
+#else
+#define APN "internet" 
+#define APN_USERNAME "web"
+#define APN_PASSWORD "web"
+#endif
\ No newline at end of file
--- a/VodafoneTestCase.h	Tue Dec 18 13:57:14 2012 +0000
+++ b/VodafoneTestCase.h	Tue Mar 05 14:59:24 2013 +0000
@@ -14,6 +14,8 @@
          return _lastRunOutcome;  
       }
       
+      virtual ~VodafoneTestCase() {}
+      
    private:
       
       virtual void setupTest() {
--- a/VodafoneUSBModem_bleedingedge.lib	Tue Dec 18 13:57:14 2012 +0000
+++ b/VodafoneUSBModem_bleedingedge.lib	Tue Mar 05 14:59:24 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/ashleymills/code/VodafoneUSBModem_bleedingedge/#6083cb11f170
+http://mbed.org/users/ashleymills/code/VodafoneUSBModem_bleedingedge/#897a0de9d668
--- a/main.cpp	Tue Dec 18 13:57:14 2012 +0000
+++ b/main.cpp	Tue Mar 05 14:59:24 2013 +0000
@@ -51,9 +51,12 @@
   LOG("Running tests.");
   TestManager *m = new TestManager(&modem);
   //m->runTestProfile(TESTS_MANUAL);
+  //m->runTest(0);
+  //Thread::wait(2000);
+  //m->runTest(1);
   //m->runTest(14);
-  m->runTestProfile(TESTS_AUTOMATED);
-  //m->runTest(11);
+  //m->runTestProfile(TESTS_AUTOMATED);
+  m->runTest(11);
   // this thread just waits and blinks leds periodically
   while(1) {
      led1 = !led1;
--- a/mbed-rtos.lib	Tue Dec 18 13:57:14 2012 +0000
+++ b/mbed-rtos.lib	Tue Mar 05 14:59:24 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#88a1a9c26ae3
+http://mbed.org/users/mbed_official/code/mbed-rtos/#53e6cccd8782
--- a/mbed.bld	Tue Dec 18 13:57:14 2012 +0000
+++ b/mbed.bld	Tue Mar 05 14:59:24 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/63cdd78b2dc1
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/3d0ef94e36ec
\ No newline at end of file