Example program to demonstrate the use of the modem providing CAT-M1, NB1 and 2G support. It may be used on the C030-R412M boards.

Dependencies:   ublox-at-cellular-interface ublox-cellular-base ublox-cellular-base-n2xx ublox-at-cellular-interface-n2xx

Revision:
2:9a617f1fedb4
Parent:
1:b9de22f79488
--- a/main.cpp	Wed Jun 12 15:51:35 2019 +0500
+++ b/main.cpp	Mon Jun 24 14:12:14 2019 +0500
@@ -15,40 +15,32 @@
  */
 #include "mbed.h"
 #include "UbloxATCellularInterface.h"
-#include "CellularContext.h"
 #include "UbloxATCellularInterfaceN2xx.h"
 
 #define UBLOX_AT_CELLULAR_INTERFACE      1
-#define ONBOARD_CELLULAR_INTERFACE       2
-#define UBLOX_AT_CELLULAR_INTERFACE_N2XX 3
+#define UBLOX_AT_CELLULAR_INTERFACE_N2XX 2
 
 // You must select the correct interface library for your board, by
 // uncommenting the correct line below. Supported combinations are
 // indicated with a "Y" in the table below.
 //
-//                                   C030_U201   C030_N211      C027
-// UBLOX_AT_CELLULAR_INTERFACE           Y            -           Y
-// ONBOARD_CELLULAR_INTERFACE            Y            -           Y
-// UBLOX_AT_CELLULAR_INTERFACE_N2XX      -            Y           -
+//                            C030_U201   C030_N211      C027     C030_R41XM
+// UbloxATCellularInterface       Y            -           Y          Y
+// UbloxATCellularInterfaceN2xx   -            Y           -          -
 // Note: the N211 module supports only UDP, not TCP
 
-// ONBOARD_CELLULAR_INTERFACE uses LWIP and the PPP cellular interface
-// on the mbed MCU, while using UBLOX_AT_CELLULAR_INTERFACE and
-// UBLOX_AT_CELLULAR_INTERFACE_N2XX uses an IP stack on the cellular
-// module and hence uses less RAM (significant on C027).  This also
-// allows other AT command operations (e.g. sending an SMS) to happen
+// UbloxATCellularInterface and UbloxATCellularInterfaceN2xx
+// uses an IP stack on the cellular module and hence uses less RAM (significant on C027).
+// This also allows other AT command operations (e.g. sending an SMS) to happen
 // during a data transfer (for which you should replace the
-// UBLOX_AT_CELLULAR_INTERFACE library with the UbloxATCellularInterfaceExt
+// UbloxATCellularInterface library with the UbloxATCellularInterfaceExt
 // library).  However, it is slower than using the LWIP/PPP on the mbed
 // MCU interface since more string parsing is required.
 #define INTERFACE_USED UBLOX_AT_CELLULAR_INTERFACE
-//#define INTERFACE_USED ONBOARD_CELLULAR_INTERFACE
 //#define INTERFACE_USED UBLOX_AT_CELLULAR_INTERFACE_N2XX
 
 #if (INTERFACE_USED == UBLOX_AT_CELLULAR_INTERFACE)
 #define INTERFACE_CLASS  UbloxATCellularInterface
-#elif (INTERFACE_USED == ONBOARD_CELLULAR_INTERFACE)
-#define INTERFACE_CLASS  OnboardCellularInterface
 #elif (INTERFACE_USED == UBLOX_AT_CELLULAR_INTERFACE_N2XX)
 #define INTERFACE_CLASS  UbloxATCellularInterfaceN2xx
 #else
@@ -134,7 +126,6 @@
 static void cbButton()
 {
     buttonPressed = true;
-    pulseEvent();
 }
 
 #if (INTERFACE_USED == UBLOX_AT_CELLULAR_INTERFACE) && defined(TARGET_UBLOX_C030_R412M)
@@ -199,11 +190,10 @@
 #endif
 
 /* This example program for the u-blox C030 and C027 boards instantiates
- * the UbloxATCellularInterface or OnboardCellularInterface and uses it
- * to make a simple sockets connection to a server, using 2.pool.ntp.org
- * for UDP and developer.mbed.org for TCP.  For a more comprehensive example,
- * where higher layer protocols make use of the same sockets interface,
- * see example-ublox-mbed-client.
+ * the UbloxATCellularInterface and uses it to make a simple sockets
+ * connection to a server, using 2.pool.ntp.org for UDP and developer.mbed.org for TCP.
+ * For a more comprehensive example, where higher layer protocols
+ * make use of the same sockets interface, see example-ublox-mbed-client.
  * Progress may be monitored with a serial terminal running at 9600 baud.
  * The LED on the C030 board will turn green when this program is
  * operating correctly, pulse blue when a sockets operation is completed
@@ -255,7 +245,7 @@
 #endif
     pulseEvent();
 
-    printf("\nGetting the IP address of \"developer.mbed.org\" and \"2.pool.ntp.org\"...\n");
+    printf("\nGetting the IP address of \"" TCP_SERVER "\" and \"2.pool.ntp.org\"...\n");
     if ((interface->gethostbyname("2.pool.ntp.org", &udpServer) == 0) &&
         (interface->gethostbyname(TCP_SERVER, &tcpServer) == 0)) {
         pulseEvent();