HTTPClient test for IoT Workshop

Dependencies:   UbloxUSBModem mbed

Fork of UbloxModemHTTPClientTest by mbed official

Revision:
3:03b3ef627772
Parent:
2:90109b8848e5
Child:
4:63be88fa16e9
--- a/main.cpp	Mon Oct 21 11:48:47 2013 +0300
+++ b/main.cpp	Tue Oct 22 10:30:28 2013 +0100
@@ -1,6 +1,12 @@
-#include "UBloxUSBGSMModem.h"
+#include "UbloxUSBGSMModem.h"
+#include "UbloxUSBCDMAModem.h"
 #include "httptest.h"
 
+#if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA)
+#warning No modem defined, using GSM by default
+#define MODEM_UBLOX_GSM
+#endif
+
 #ifndef MODEM_APN
 #warning APN not specified, using "internet"
 #define MODEM_APN "internet"
@@ -16,23 +22,14 @@
 #define MODEM_PASSWORD NULL
 #endif
 
-void test(void const* data)
+int main()
 {
+#ifdef MODEM_UBLOX_GSM
     UbloxUSBGSMModem modem;
+#else
+    UbloxUSBCDMAModem modem(p18, true, 1);
+#endif
     httptest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD);
     while (true);
 }
 
-int main()
-{
-    Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
-    DigitalOut led(LED1);
-
-    while (true)
-    {
-        led = !led;
-        Thread::wait(1000);  
-    }
-    return 0;
-}
-