u-blox modem HTTP client test
Dependencies: UbloxUSBModem mbed
main.cpp@5:dcad6eda763e, 2013-11-04 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Nov 04 09:00:29 2013 +0000
- Revision:
- 5:dcad6eda763e
- Parent:
- 4:63be88fa16e9
Synchronized with git revision 8e4057efabf71902a57a8e71ad47141e1e2f98c9
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 | |
mbed_official | 3:03b3ef627772 | 5 | #if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA) |
mbed_official | 3:03b3ef627772 | 6 | #warning No modem defined, using GSM by default |
mbed_official | 3:03b3ef627772 | 7 | #define MODEM_UBLOX_GSM |
mbed_official | 3:03b3ef627772 | 8 | #endif |
mbed_official | 3:03b3ef627772 | 9 | |
bogdanm | 1:0112fc45285a | 10 | #ifndef MODEM_APN |
bogdanm | 1:0112fc45285a | 11 | #warning APN not specified, using "internet" |
bogdanm | 2:90109b8848e5 | 12 | #define MODEM_APN "internet" |
bogdanm | 1:0112fc45285a | 13 | #endif |
bogdanm | 1:0112fc45285a | 14 | |
bogdanm | 1:0112fc45285a | 15 | #ifndef MODEM_USERNAME |
bogdanm | 1:0112fc45285a | 16 | #warning username not specified |
bogdanm | 2:90109b8848e5 | 17 | #define MODEM_USERNAME NULL |
bogdanm | 1:0112fc45285a | 18 | #endif |
bogdanm | 1:0112fc45285a | 19 | |
bogdanm | 1:0112fc45285a | 20 | #ifndef MODEM_PASSWORD |
bogdanm | 1:0112fc45285a | 21 | #warning password not specified |
bogdanm | 2:90109b8848e5 | 22 | #define MODEM_PASSWORD NULL |
bogdanm | 1:0112fc45285a | 23 | #endif |
bogdanm | 1:0112fc45285a | 24 | |
mbed_official | 3:03b3ef627772 | 25 | int main() |
bogdanm | 2:90109b8848e5 | 26 | { |
mbed_official | 3:03b3ef627772 | 27 | #ifdef MODEM_UBLOX_GSM |
bogdanm | 2:90109b8848e5 | 28 | UbloxUSBGSMModem modem; |
mbed_official | 3:03b3ef627772 | 29 | #else |
mbed_official | 3:03b3ef627772 | 30 | UbloxUSBCDMAModem modem(p18, true, 1); |
mbed_official | 3:03b3ef627772 | 31 | #endif |
bogdanm | 2:90109b8848e5 | 32 | httptest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD); |
bogdanm | 2:90109b8848e5 | 33 | while (true); |
bogdanm | 2:90109b8848e5 | 34 | } |
bogdanm | 2:90109b8848e5 | 35 |