Implementation of the CellularInterface for u-blox C027 and C030 (non-N2xx flavour) modems that uses the IP stack on-board the cellular modem, hence not requiring LWIP (and so less RAM) and allowing any AT command exchanges to be carried out at the same time as data transfers (since the modem remains in AT mode all the time). This library may be used from mbed 5.5 onwards. If you need to use SMS, USSD or access the modem file system at the same time as using the CellularInterface then use ublox-at-cellular-interface-ext instead.

Dependents:   example-ublox-cellular-interface example-ublox-cellular-interface_r410M example-ublox-mbed-client example-ublox-cellular-interface ... more

Revision:
15:8cc9a80ac0ad
Parent:
14:e7dcf3388403
Child:
16:2b30a056ae54
diff -r e7dcf3388403 -r 8cc9a80ac0ad UbloxATCellularInterface.cpp
--- a/UbloxATCellularInterface.cpp	Fri Mar 02 13:28:32 2018 +0000
+++ b/UbloxATCellularInterface.cpp	Mon Mar 26 15:33:40 2018 +0100
@@ -561,6 +561,11 @@
 
     MBED_ASSERT (check_socket(socket));
 
+    if (socket->modem_handle == SOCKET_UNUSED) {
+        tr_debug("socket_send: socket closed");
+        return NSAPI_ERROR_NO_SOCKET;
+    }
+
     while ((count > 0) && success) {
         if (count < blk) {
             blk = count;
@@ -669,6 +674,11 @@
 
     MBED_ASSERT (check_socket(socket));
 
+    if (socket->modem_handle == SOCKET_UNUSED) {
+        tr_debug("socket_recv: socket closed");
+        return NSAPI_ERROR_NO_SOCKET;
+    }
+
     timer.start();
 
     while (success && (size > 0)) {