mbed official / Mbed 2 deprecated UbloxModemWebsocketTest

Dependencies:   UbloxUSBModem WebSocketClient mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "UbloxUSBGSMModem.h"
00002 #include "UbloxUSBCDMAModem.h"
00003 #include "websocketstest.h"
00004 
00005 #define MODEM_UBLOX_CDMA
00006 //#define MODEM_UBLOX_GSM
00007 
00008 #if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA)
00009 #warning No modem defined, using GSM by default
00010 #define MODEM_UBLOX_GSM
00011 #endif
00012 
00013 #ifndef MODEM_APN
00014 #warning APN not specified, using "internet"
00015 #define MODEM_APN "internet"
00016 #endif
00017 
00018 #ifndef MODEM_USERNAME
00019 #warning username not specified
00020 #define MODEM_USERNAME NULL
00021 #endif
00022 
00023 #ifndef MODEM_PASSWORD
00024 #warning password not specified
00025 #define MODEM_PASSWORD NULL
00026 #endif
00027 
00028 int main()
00029 {
00030 #ifdef MODEM_UBLOX_GSM
00031     UbloxUSBGSMModem modem;
00032 #else
00033     UbloxUSBCDMAModem modem(p18, true, 1);
00034 #endif
00035     websocketstest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD);
00036     while (true);
00037 }