HTTPClient test for IoT Workshop
Dependencies: UbloxUSBModem mbed
Fork of UbloxModemHTTPClientTest by
main.cpp@6:8cf840145f92, 2014-02-03 (annotated)
- Committer:
- sam_grove
- Date:
- Mon Feb 03 14:35:03 2014 +0000
- Revision:
- 6:8cf840145f92
- Parent:
- 5:dcad6eda763e
update to make CDMA default
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 3:03b3ef627772 | 1 | #include "UbloxUSBGSMModem.h" |
mbed_official | 3:03b3ef627772 | 2 | #include "UbloxUSBCDMAModem.h" |
bogdanm | 1:0112fc45285a | 3 | #include "httptest.h" |
bogdanm | 1:0112fc45285a | 4 | |
sam_grove | 6:8cf840145f92 | 5 | #define MODEM_UBLOX_CDMA |
sam_grove | 6:8cf840145f92 | 6 | |
mbed_official | 3:03b3ef627772 | 7 | #if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA) |
mbed_official | 3:03b3ef627772 | 8 | #warning No modem defined, using GSM by default |
mbed_official | 3:03b3ef627772 | 9 | #define MODEM_UBLOX_GSM |
mbed_official | 3:03b3ef627772 | 10 | #endif |
mbed_official | 3:03b3ef627772 | 11 | |
bogdanm | 1:0112fc45285a | 12 | #ifndef MODEM_APN |
bogdanm | 1:0112fc45285a | 13 | #warning APN not specified, using "internet" |
bogdanm | 2:90109b8848e5 | 14 | #define MODEM_APN "internet" |
bogdanm | 1:0112fc45285a | 15 | #endif |
bogdanm | 1:0112fc45285a | 16 | |
bogdanm | 1:0112fc45285a | 17 | #ifndef MODEM_USERNAME |
bogdanm | 1:0112fc45285a | 18 | #warning username not specified |
bogdanm | 2:90109b8848e5 | 19 | #define MODEM_USERNAME NULL |
bogdanm | 1:0112fc45285a | 20 | #endif |
bogdanm | 1:0112fc45285a | 21 | |
bogdanm | 1:0112fc45285a | 22 | #ifndef MODEM_PASSWORD |
bogdanm | 1:0112fc45285a | 23 | #warning password not specified |
bogdanm | 2:90109b8848e5 | 24 | #define MODEM_PASSWORD NULL |
bogdanm | 1:0112fc45285a | 25 | #endif |
bogdanm | 1:0112fc45285a | 26 | |
mbed_official | 3:03b3ef627772 | 27 | int main() |
bogdanm | 2:90109b8848e5 | 28 | { |
mbed_official | 3:03b3ef627772 | 29 | #ifdef MODEM_UBLOX_GSM |
bogdanm | 2:90109b8848e5 | 30 | UbloxUSBGSMModem modem; |
mbed_official | 3:03b3ef627772 | 31 | #else |
mbed_official | 3:03b3ef627772 | 32 | UbloxUSBCDMAModem modem(p18, true, 1); |
sam_grove | 6:8cf840145f92 | 33 | printf("CDMA MODEM\n"); |
mbed_official | 3:03b3ef627772 | 34 | #endif |
bogdanm | 2:90109b8848e5 | 35 | httptest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD); |
bogdanm | 2:90109b8848e5 | 36 | while (true); |
bogdanm | 2:90109b8848e5 | 37 | } |
bogdanm | 2:90109b8848e5 | 38 |