mbed 5.4 with sleep mode
Dependencies: C027_Support mbed-dev
Fork of C027_SupportTest_coap by
Diff: main.cpp
- Revision:
- 9:26f694bc31b4
- Parent:
- 7:e000317ddef6
- Child:
- 10:d2da2028a233
--- a/main.cpp Thu Apr 10 13:45:20 2014 +0000 +++ b/main.cpp Thu Apr 17 15:10:09 2014 +0000 @@ -3,6 +3,28 @@ #include "GPS.h" #include "MDM.h" +//---------------------------------------------------------------------- +// You may need to configure these parameters + +/** Set your secret SIM pin here "1234" +*/ +#define SIMPIN NULL + +/** The APN of your network operator, sometimes it is "internet" + check your contract with the network operator +*/ +#define APN "gprs.swisscom.ch" + +/** Set the user name for your APN, or NULL if not needed +*/ +#define USERNAME NULL + +/** Set the password for your APN, or NULL if not needed +*/ +#define PASSWORD NULL + +//---------------------------------------------------------------------- + C027 c027; void printDeviceStatus(MDMParser::DevStatus* status) { @@ -75,7 +97,7 @@ printf("Device Init\r\n"); MDMParser::DevStatus devStatus; MDMParser::NetStatus netStatus; - if (mdm.init(/* SIM PIN = */ NULL, &devStatus)) + if (mdm.init(SIMPIN, &devStatus)) { printDeviceStatus(&devStatus); @@ -88,9 +110,7 @@ printf("Network Join\r\n"); // join the internet connection MDMParser::IP ip = - mdm.join(/* APN = */ "gprs.swisscom.ch", - /* USER = */ NULL, - /* PASSWORD = */ NULL); + mdm.join(APN,USERNAME,PASSWORD); if (ip != NOIP) { printf(" IP Address: " IPSTR "\r\n", IPNUM(ip)); @@ -187,7 +207,7 @@ } } wait_ms(wait); - } + } mdm.powerOff(); gps.powerOff(); }