Simple example program to demonstrate and test cellular connection using the MTSAS library (over PPP protocol)

Dependencies:   mbed mtsas

Revision:
5:46e66c649006
Parent:
4:8b02a6b67f4d
Child:
7:3e937d898953
diff -r 8b02a6b67f4d -r 46e66c649006 main.cpp
--- 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");