HTTPClient test for IoT Workshop

Dependencies:   UbloxUSBModem mbed

Fork of UbloxModemHTTPClientTest by mbed official

Committer:
bogdanm
Date:
Mon Oct 21 11:48:47 2013 +0300
Revision:
2:90109b8848e5
Parent:
1:0112fc45285a
Child:
3:03b3ef627772
Fixed macro names, made test non-automated, added second thread.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 1:0112fc45285a 1 #include "UBloxUSBGSMModem.h"
bogdanm 1:0112fc45285a 2 #include "httptest.h"
bogdanm 1:0112fc45285a 3
bogdanm 1:0112fc45285a 4 #ifndef MODEM_APN
bogdanm 1:0112fc45285a 5 #warning APN not specified, using "internet"
bogdanm 2:90109b8848e5 6 #define MODEM_APN "internet"
bogdanm 1:0112fc45285a 7 #endif
bogdanm 1:0112fc45285a 8
bogdanm 1:0112fc45285a 9 #ifndef MODEM_USERNAME
bogdanm 1:0112fc45285a 10 #warning username not specified
bogdanm 2:90109b8848e5 11 #define MODEM_USERNAME NULL
bogdanm 1:0112fc45285a 12 #endif
bogdanm 1:0112fc45285a 13
bogdanm 1:0112fc45285a 14 #ifndef MODEM_PASSWORD
bogdanm 1:0112fc45285a 15 #warning password not specified
bogdanm 2:90109b8848e5 16 #define MODEM_PASSWORD NULL
bogdanm 1:0112fc45285a 17 #endif
bogdanm 1:0112fc45285a 18
bogdanm 2:90109b8848e5 19 void test(void const* data)
bogdanm 2:90109b8848e5 20 {
bogdanm 2:90109b8848e5 21 UbloxUSBGSMModem modem;
bogdanm 2:90109b8848e5 22 httptest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD);
bogdanm 2:90109b8848e5 23 while (true);
bogdanm 2:90109b8848e5 24 }
bogdanm 2:90109b8848e5 25
bogdanm 1:0112fc45285a 26 int main()
bogdanm 1:0112fc45285a 27 {
bogdanm 2:90109b8848e5 28 Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
bogdanm 2:90109b8848e5 29 DigitalOut led(LED1);
bogdanm 1:0112fc45285a 30
bogdanm 2:90109b8848e5 31 while (true)
bogdanm 2:90109b8848e5 32 {
bogdanm 2:90109b8848e5 33 led = !led;
bogdanm 2:90109b8848e5 34 Thread::wait(1000);
bogdanm 2:90109b8848e5 35 }
bogdanm 2:90109b8848e5 36 return 0;
bogdanm 1:0112fc45285a 37 }
bogdanm 2:90109b8848e5 38