u-blox modem Websockets client test
Dependencies: UbloxUSBModem WebSocketClient mbed
main.cpp@4:7151de45f03b, 2013-10-31 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Oct 31 03:34:32 2013 +0000
- Revision:
- 4:7151de45f03b
- Parent:
- 1:46a74633a5cc
Changed default modem to CDMA
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 1:46a74633a5cc | 1 | #include "UbloxUSBGSMModem.h" |
mbed_official | 1:46a74633a5cc | 2 | #include "UbloxUSBCDMAModem.h" |
mbed_official | 1:46a74633a5cc | 3 | #include "websocketstest.h" |
mbed_official | 0:f1ad9e7a8fe2 | 4 | |
mbed_official | 4:7151de45f03b | 5 | #define MODEM_UBLOX_CDMA |
mbed_official | 4:7151de45f03b | 6 | //#define MODEM_UBLOX_GSM |
mbed_official | 0:f1ad9e7a8fe2 | 7 | |
mbed_official | 1:46a74633a5cc | 8 | #if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA) |
mbed_official | 1:46a74633a5cc | 9 | #warning No modem defined, using GSM by default |
mbed_official | 1:46a74633a5cc | 10 | #define MODEM_UBLOX_GSM |
mbed_official | 0:f1ad9e7a8fe2 | 11 | #endif |
mbed_official | 0:f1ad9e7a8fe2 | 12 | |
mbed_official | 1:46a74633a5cc | 13 | #ifndef MODEM_APN |
mbed_official | 1:46a74633a5cc | 14 | #warning APN not specified, using "internet" |
mbed_official | 1:46a74633a5cc | 15 | #define MODEM_APN "internet" |
mbed_official | 1:46a74633a5cc | 16 | #endif |
mbed_official | 1:46a74633a5cc | 17 | |
mbed_official | 1:46a74633a5cc | 18 | #ifndef MODEM_USERNAME |
mbed_official | 1:46a74633a5cc | 19 | #warning username not specified |
mbed_official | 1:46a74633a5cc | 20 | #define MODEM_USERNAME NULL |
mbed_official | 1:46a74633a5cc | 21 | #endif |
mbed_official | 1:46a74633a5cc | 22 | |
mbed_official | 1:46a74633a5cc | 23 | #ifndef MODEM_PASSWORD |
mbed_official | 1:46a74633a5cc | 24 | #warning password not specified |
mbed_official | 1:46a74633a5cc | 25 | #define MODEM_PASSWORD NULL |
mbed_official | 1:46a74633a5cc | 26 | #endif |
mbed_official | 0:f1ad9e7a8fe2 | 27 | |
mbed_official | 0:f1ad9e7a8fe2 | 28 | int main() |
mbed_official | 0:f1ad9e7a8fe2 | 29 | { |
mbed_official | 1:46a74633a5cc | 30 | #ifdef MODEM_UBLOX_GSM |
mbed_official | 0:f1ad9e7a8fe2 | 31 | UbloxUSBGSMModem modem; |
mbed_official | 1:46a74633a5cc | 32 | #else |
mbed_official | 0:f1ad9e7a8fe2 | 33 | UbloxUSBCDMAModem modem(p18, true, 1); |
mbed_official | 0:f1ad9e7a8fe2 | 34 | #endif |
mbed_official | 1:46a74633a5cc | 35 | websocketstest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD); |
mbed_official | 1:46a74633a5cc | 36 | while (true); |
mbed_official | 0:f1ad9e7a8fe2 | 37 | } |