![](/media/cache/profiles/af7fc8485f40dc495bc626d6dbe7faf1.50x50_q85.png)
u-blox modem Websockets client test
Dependencies: UbloxUSBModem WebSocketClient mbed
Diff: main.cpp
- Revision:
- 1:46a74633a5cc
- Parent:
- 0:f1ad9e7a8fe2
- Child:
- 4:7151de45f03b
--- a/main.cpp Tue Oct 22 04:25:34 2013 +0000 +++ b/main.cpp Tue Oct 22 10:17:11 2013 +0000 @@ -1,41 +1,37 @@ - -#define CDMA_TEST -//#define GSM_TEST - -#if defined (GSM_TEST) - #include "UbloxUSBGSMModem.h" - #ifndef MODEM_APN - #warning APN not specified, using "internet" - #define APN "internet" - #endif +#include "UbloxUSBGSMModem.h" +#include "UbloxUSBCDMAModem.h" +#include "websocketstest.h" - #ifndef MODEM_USERNAME - #warning username not specified - #define USERNAME NULL - #endif +//#define MODEM_UBLOX_CDMA +#define MODEM_UBLOX_GSM - #ifndef MODEM_PASSWORD - #warning password not specified - #define PASSWORD NULL - #endif - -#elif defined (CDMA_TEST) - #include "UbloxUSBCDMAModem.h" - -#elif - #warning modem type not specified +#if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA) +#warning No modem defined, using GSM by default +#define MODEM_UBLOX_GSM #endif -#include "websocketstest.h" +#ifndef MODEM_APN +#warning APN not specified, using "internet" +#define MODEM_APN "internet" +#endif + +#ifndef MODEM_USERNAME +#warning username not specified +#define MODEM_USERNAME NULL +#endif + +#ifndef MODEM_PASSWORD +#warning password not specified +#define MODEM_PASSWORD NULL +#endif int main() { -#if defined (GSM_TEST) +#ifdef MODEM_UBLOX_GSM UbloxUSBGSMModem modem; - websocketstest(modem, APN, USERNAME, PASSWORD); -#elif defined (CDMA_TEST) +#else UbloxUSBCDMAModem modem(p18, true, 1); - websocketstest(modem); #endif - while(1); + websocketstest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD); + while (true); }