Implementation of the CellularInterface for u-blox C030 boards with N2xx modems. Note: requires the N211 module firmware to be at least 06.57 A01.02.

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

Revision:
7:69e676f4af84
Parent:
6:658419981430
Child:
8:0162c103346a
--- a/UbloxATCellularInterfaceN2xx.cpp	Wed Sep 13 15:57:06 2017 +0100
+++ b/UbloxATCellularInterfaceN2xx.cpp	Thu Sep 14 10:29:22 2017 +0100
@@ -255,7 +255,7 @@
     nsapi_size_or_error_t nsapi_error_size = NSAPI_ERROR_DEVICE_ERROR;
     bool success = true;
     const char *buf = (const char *) data;
-    nsapi_size_t blk = MAX_WRITE_SIZE;
+    nsapi_size_t blk = MAX_WRITE_SIZE_N2XX;
     nsapi_size_t count = size;
     SockCtrl *socket = (SockCtrl *) handle;
 
@@ -264,9 +264,9 @@
 
     MBED_ASSERT (check_socket(socket));
 
-    tr_debug("Max Write Size for SendTo: %d", MAX_WRITE_SIZE);
-    if (size > MAX_WRITE_SIZE) {
-        tr_warn("WARNING: packet length %d is too big for one UDP packet (max %d), will be fragmented.", size, MAX_WRITE_SIZE);
+    tr_debug("Max Write Size for SendTo: %d", MAX_WRITE_SIZE_N2XX);
+    if (size > MAX_WRITE_SIZE_N2XX) {
+        tr_warn("WARNING: packet length %d is too big for one UDP packet (max %d), will be fragmented.", size, MAX_WRITE_SIZE_N2XX);
     }
 
     while ((count > 0) && success) {
@@ -432,7 +432,7 @@
         at_timeout = _at_timeout;
         at_set_timeout(1000);
         
-        read_blk = MAX_READ_SIZE;
+        read_blk = MAX_READ_SIZE_N2XX;
         if (read_blk > size) {
             read_blk = size;
         }
@@ -460,7 +460,7 @@
                 buf += nsapi_error_size;
                 size -= nsapi_error_size;
                 
-                if (((uint)nsapi_error_size < read_blk) || (nsapi_error_size == MAX_READ_SIZE))
+                if (((uint)nsapi_error_size < read_blk) || (nsapi_error_size == MAX_READ_SIZE_N2XX))
                     size = 0;     // If we've received less than we asked for, or
                                   // the max size, then a whole UDP packet has arrived and
                                   // this means DONE.
@@ -506,7 +506,7 @@
 
     memset (ipAddress, 0, sizeof (ipAddress)); // Ensure terminator
     
-    if (length > MAX_READ_SIZE) {
+    if (length > MAX_READ_SIZE_N2XX) {
         return NSAPI_ERROR_UNSUPPORTED;
     }