Sample project to connect to AT&T M2X from the STM32 Nucleo + MTSAS Cellular SocketModem shield
Dependencies: M2XStreamClient jsonlite mbed
Fork of MTSAS_Cellular_Connect_M2X_Example_F411 by
Diff: main.cpp
- Revision:
- 5:46e66c649006
- Parent:
- 4:8b02a6b67f4d
- Child:
- 7:3e937d898953
--- a/main.cpp Mon Jul 28 15:09:18 2014 +0000 +++ b/main.cpp Mon Jul 28 15:15:53 2014 +0000 @@ -39,10 +39,10 @@ Cellular* radio = CellularFactory::create(io); for (int i = 0; i < 10; i++) { if (i >= 10) { - logError("Failed to set APN"); + logError("Failed to set APN to %s", APN); } if (radio->setApn(APN) == MTS_SUCCESS) { - logInfo("Successfully set APN [%s]", APN); + logInfo("Successfully set APN to %s", APN); break; } else { wait(1); @@ -52,7 +52,7 @@ //Establish PPP link for (int i = 0; i < 10; i++) { if (i >= 10) { - logError("Failed to connect to cell network"); + logError("Failed to establish PPP link"); } if (radio->connect() == true) { logInfo("Successfully established PPP link"); @@ -65,7 +65,7 @@ //Ping google.com for (int i = 0; i < 10; i++) { if (i >= 10) { - logError("Failed to ping google.com"); + logError("Failed to ping www.google.com"); } if (radio->ping("www.google.com") == true) { logInfo("Successfully pinged www.google.com");