NTPClientTest, working with SARA-G350 on C027
Dependencies: C027 NTPClient UbloxUSBModem mbed
Fork of C027_USSDTest_SARA350 by
Revision 12:88552ae75244, committed 2014-03-03
- Comitter:
- mazgch
- Date:
- Mon Mar 03 07:49:48 2014 +0000
- Parent:
- 10:e2315bcdd7be
- Child:
- 13:9350ec2ec1cd
- Commit message:
- Updated HttpClientTest; Need to use mbed libraries revision 74 (the new flow control handling breaks the serial port);
Changed in this revision
--- a/C027.lib Wed Nov 06 10:49:08 2013 +0000 +++ b/C027.lib Mon Mar 03 07:49:48 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/ublox/code/C027/#bc9e2eb5daa8 +http://mbed.org/teams/ublox/code/C027/#e30f90b5447e
--- a/UbloxUSBModem.lib Wed Nov 06 10:49:08 2013 +0000 +++ b/UbloxUSBModem.lib Mon Mar 03 07:49:48 2014 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/mbed_official/code/UbloxUSBModem/#6e9d98f8c237 +https://mbed.org/users/mbed_official/code/UbloxUSBModem/#bc1c98e552ab
--- a/main.cpp Wed Nov 06 10:49:08 2013 +0000 +++ b/main.cpp Mon Mar 03 07:49:48 2014 +0000 @@ -1,20 +1,54 @@ #include "mbed.h" #include "C027.h" -#include "UbloxUSBGSMModem.h" -#include "UbloxUSBCDMAModem.h" +#include "UbloxModem.h" #include "HTTPClient.h" C027 c027; +#define MODEM_APN "gprs.swisscom.ch" + +#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 + void test(void const*) { +#if 1 + // Serial is supported by LISA-C, LISA-U and SARA-G c027.mdmPower(true); - UbloxUSBGSMModem modem; // for LISA-C use the UbloxUSBCDMAModem instead + wait_ms(5000); + UbloxSerModem modem; +#else + // USB is supported by LISA-C or LISA-U + c027.mdmUsbEnable(true); + c027.mdmPower(true); + wait_ms(5000); + UbloxUSBModem modem; +#endif + HTTPClient http; char str[512]; - int ret = modem.connect("internet"); // eventaully set another apn here + int ret; + for (;;) + { + ret = modem.connect(MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD); // eventaully set another apn here + if (!ret) + break; + wait_ms(1000); + } if(ret) { printf("Could not connect %d\n", ret);
--- a/mbed.bld Wed Nov 06 10:49:08 2013 +0000 +++ b/mbed.bld Mon Mar 03 07:49:48 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/a842253909c9 \ No newline at end of file