Example program for the UbloxCellularDriverGen class, providing SMS, USSD and module file system support. This program may be used on the C027 and C030 (non N2xx-flavour) boards.

Dependencies:   ublox-cellular-driver-gen ublox-cellular-base

Revision:
5:77134c30d863
Parent:
4:39208ab9cc04
Child:
7:414c52e89560
--- a/main.cpp	Tue Jun 13 02:01:05 2017 +0100
+++ b/main.cpp	Tue Jun 13 10:51:08 2017 +0100
@@ -144,7 +144,7 @@
 int main()
 {
     UbloxCellularDriverGen *driver = new UbloxCellularDriverGen();
-    // If you need to debug the cellular interface, comment out the
+    // If you need to debug the cellular driver, comment out the
     // instantiation above and uncomment the one below.
 //    UbloxCellularDriverGen *driver = new UbloxCellularDriverGen(MDMTXD, MDMRXD,
 //                                                                MBED_CONF_UBLOX_CELL_BAUD_RATE,
@@ -153,7 +153,12 @@
     int x;
     int index[8];
     char number[32];
+#ifdef TARGET_UBLOX_C027
+    // No user button on C027
+    InterruptIn userButton(NC);
+#else
     InterruptIn userButton(SW0);
+#endif
     
     // Attach a function to the user button
     userButton.rise(&cbButton);
@@ -213,7 +218,7 @@
             printf("No destination SMS number has been defined (edit DESTINATION_SMS_NUMBER in this file to add one).\n");
         }
         
-        printf("Waiting for SMS messages to arrive in a loop until the user button is pressed...\n");
+        printf("Waiting for SMS messages to arrive in a loop until the user button is pressed on C030 or forever on C027......\n");
         while (!buttonPressed) {
             x = driver->smsList("REC UNREAD", index, sizeof(index));
             for (int y = 0; y < x; y++) {
@@ -234,7 +239,9 @@
                 }
             }
             wait_ms(2500);
+#ifndef TARGET_UBLOX_C027
             printf("[Checking if user button has been pressed]\n");
+#endif
         }
         
         pulseEvent();