Example program running mbedClient over UbloxATCellularInterface or OnboardCellularInterface for the C030 platform.

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

Revision:
13:c1f582d9ad94
Parent:
12:78e41b0a374f
Child:
15:21e0bf60dd0c
--- a/main.cpp	Thu Sep 14 11:08:10 2017 +0100
+++ b/main.cpp	Thu Sep 28 09:21:54 2017 +0100
@@ -30,25 +30,25 @@
 #include "mbed_trace.h"
 #include "mbed.h"
 
-// You must select the correct interface library for your board,
-// where supported combinations are indicated with a "Y" in the
-// table below.
+// 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
-// UbloxPPPCellularInterface      Y            -           Y
-// UbloxATCellularInterface       Y            -           Y
-// UbloxATCellularInterfaceN2xx   -            Y           -
+//                            C030_U201   C030_N211
+// UbloxPPPCellularInterface      Y            -
+// UbloxATCellularInterface       Y            -
+// UbloxATCellularInterfaceN2xx   -            Y
 // Note: the N211 module supports only UDP, not TCP
 
 // UbloxPPPCellularInterface uses LWIP and the PPP cellular interface
 // on the mbed MCU, while using 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
-// 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.
+// module and hence uses less RAM.  This also allows other AT command
+// operations (e.g. sending an SMS) to happen during a data transfer
+// (for which you should replace the 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_CLASS  UbloxATCellularInterface
 //#define INTERFACE_CLASS  UbloxPPPCellularInterface
 //#define INTERFACE_CLASS  UbloxATCellularInterfaceN2xx
@@ -171,10 +171,12 @@
 int main()
 {
     INTERFACE_CLASS *interface = new INTERFACE_CLASS();
-// If you need to debug the cellular interface, comment out the
-// instantiation above and uncomment the one below.
+    // If you need to debug the cellular interface, comment out the
+    // instantiation above and uncomment the one below.
+    // For the N2xx interface, change xxx to MBED_CONF_UBLOX_CELL_BAUD_RATE,
+    // while for the non-N2xx interface change it to MBED_CONF_UBLOX_CELL_N2XX_BAUD_RATE.
 //    INTERFACE_CLASS *interface = new INTERFACE_CLASS(MDMTXD, MDMRXD,
-//                                                     MBED_CONF_UBLOX_CELL_BAUD_RATE,
+//                                                     xxx,
 //                                                     true);
     MbedClient *mbedClient = new MbedClient(device);
     M2MObjectList objectList;
@@ -194,11 +196,7 @@
     srand(seed);
 
     // Randomize source port
-#ifdef MBEDTLS_TEST_NULL_ENTROPY
-    mbedtls_null_entropy_poll(NULL, (unsigned char *) &seed, sizeof seed, &len);
-#else
     mbedtls_hardware_poll(NULL, (unsigned char *) &seed, sizeof seed, &len);
-#endif
 
     good();
     printf("Starting up, please wait up to 180 seconds for network registration to complete...\n");