Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: main.cpp
- Revision:
- 24:8f9b678a7932
- Parent:
- 23:0a48eebaaba8
- Child:
- 27:bfd402593acc
diff -r 0a48eebaaba8 -r 8f9b678a7932 main.cpp --- a/main.cpp Mon Mar 24 09:58:46 2014 +0000 +++ b/main.cpp Tue Apr 15 16:59:56 2014 +0000 @@ -13,7 +13,7 @@ int main() { - int ret; + int ret; size_t c; puts("Started..."); io_init(); @@ -25,29 +25,29 @@ UbloxUSBGSMModem modem; cmdIface = modem.getATCommandsInterface(); - puts("Connecting..."); - if (modem.connect("")) { - puts("Searching for login..."); - // get imsi number - printf("IMSI: %s\n", imsi()); - apndb_t *apn = apndb_get(imsi()); - if (apn == NULL) - puts("No APN found."); - else - printf("APN: %s\n", apn->apn); - - if (modem.connect("public4.m2minternet.com")) { - puts("GPRS connection failure."); - return 2; - } - printf("IMSI: %s\n", imsi()); - apn = apndb_get(imsi()); - if (apn == NULL) - puts("No APN found."); - else - printf("APN: %s\n", apn->apn); + /*puts("Searching for login..."); + // get imsi number + printf("IMSI: %s\n", imsi()); + apndb_t *apn = apndb_get(imsi()); + if (apn == NULL) + puts("No APN found."); + else + printf("APN: %s\n", apn->apn); + */ + + if (modem.connect("public4.m2minternet.com")) { + puts("GPRS connection failure."); + return 2; } - + + /*printf("IMSI: %s\n", imsi()); + apn = apndb_get(imsi()); + if (apn == NULL) + puts("No APN found."); + else + printf("APN: %s\n", apn->apn); + */ + // get before starting program as they're permanent if ((!strlen(imei())) || (!strlen(iccid()))) { puts("Couldn't read IMEI or ICCID.");