Example program that uses the mbed UbloxATCellularInterface or OnboardCellularInterface classes to perform simple sockets operations. This program can be used on the C027 and C030 boards, including the C030 N2xx version with a little editing.

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

Files at this revision

API Documentation at this revision

Comitter:
RobMeades
Date:
Wed Jun 14 09:28:20 2017 +0000
Parent:
7:e3eeff78eef0
Child:
9:e5d1cc4fd9fa
Commit message:
Example now encompasses PPP cellular interface as well as AT cellular interface.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
ublox-at-cellular-interface.lib Show annotated file Show diff for this revision Revisions of this file
ublox-cellular-base.lib Show annotated file Show diff for this revision Revisions of this file
ublox-ppp-cellular-interface.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Jun 12 22:16:17 2017 +0000
+++ b/main.cpp	Wed Jun 14 09:28:20 2017 +0000
@@ -16,6 +16,16 @@
 
 #include "mbed.h"
 #include "UbloxATCellularInterface.h"
+#include "UbloxPPPCellularInterface.h"
+
+// If you wish to use LWIP and the PPP cellular interface, select
+// the line UbloxPPPCellularInterface, otherwise select the line
+// UbloxATCellularInterface.  Using the AT cellular interface does not
+// require LWIP and hence uses less RAM (significant on C027.  It also
+// allows other AT command operations (e.g. sending an SMS) to happen
+// during a data transfer.
+#define INTERFACE_CLASS  UbloxATCellularInterface
+//#define INTERFACE_CLASS  UbloxPPPCellularInterface
 
 // The credentials of the SIM in the board.  If PIN checking is enabled
 // for your SIM card you must set this to the required PIN.
@@ -111,12 +121,12 @@
 
 int main()
 {
-    UbloxATCellularInterface *interface = new UbloxATCellularInterface();
+    INTERFACE_CLASS *interface = new UbloxATCellularInterface();
     // If you need to debug the cellular interface, comment out the
     // instantiation above and uncomment the one below.
-//    UbloxATCellularInterface *interface = new UbloxATCellularInterface(MDMTXD, MDMRXD,
-//                                                                       MBED_CONF_UBLOX_CELL_BAUD_RATE,
-//                                                                       true);
+//    INTERFACE_CLASS *interface = new INTERFACE_CLASS(MDMTXD, MDMRXD,
+//                                                     MBED_CONF_UBLOX_CELL_BAUD_RATE,
+//                                                     true);
     TCPSocket sockTcp;
     UDPSocket sockUdp;
     SocketAddress udpServer;
--- a/mbed-os.lib	Mon Jun 12 22:16:17 2017 +0000
+++ b/mbed-os.lib	Wed Jun 14 09:28:20 2017 +0000
@@ -1,1 +1,1 @@
-https://github.com/u-blox/mbed-os/#4eb6495f370c0a410e6b56be6043591087990ff3
+https://github.com/u-blox/mbed-os/#35999be01802742f0c4cf302c3890da7a9fbc33d
--- a/ublox-at-cellular-interface.lib	Mon Jun 12 22:16:17 2017 +0000
+++ b/ublox-at-cellular-interface.lib	Wed Jun 14 09:28:20 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#c89190eda594
+https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#f6706249d076
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ublox-cellular-base.lib	Wed Jun 14 09:28:20 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#73fcc33c9400
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ublox-ppp-cellular-interface.lib	Wed Jun 14 09:28:20 2017 +0000
@@ -0,0 +1,1 @@
+ublox-ppp-cellular-interface#44dd95724bc2