This class adds HTTP, FTP and CellLocate client support for u-blox modules for the C027 and C030 boards (excepting the C030 N2xx flavour) from mbed 5.5 onwards. The HTTP, FTP and CellLocate operations are all hosted on the module, minimizing RAM consumption in the mbed MCU. It also sub-classes ublox-cellular-driver-gen to bring in SMS, USSD and modem file system support if you need to use these functions at the same time as the cellular interface.

Dependencies:   ublox-at-cellular-interface

Dependents:   example-ublox-at-cellular-interface-ext HelloMQTT ublox_new_driver_test example-ublox-at-cellular-interface-ext ... more

Files at this revision

API Documentation at this revision

Comitter:
fahimalavi
Date:
Fri Jun 26 10:32:02 2020 +0500
Parent:
35:6a6ee1adff84
Child:
37:1874c0d2c70e
Commit message:
SARA-R5 working changes"

Changed in this revision

UbloxATCellularInterfaceExt.cpp 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
--- a/UbloxATCellularInterfaceExt.cpp	Mon Jan 06 14:43:04 2020 +0500
+++ b/UbloxATCellularInterfaceExt.cpp	Fri Jun 26 10:32:02 2020 +0500
@@ -565,10 +565,14 @@
     bool success = false;
     int httpInParNum = 0;
     SocketAddress address;
+    int at_timeout;
 
     debug_if(_debug_trace_on, "httpSetPar(%d, %d, \"%s\")\n", httpProfile, httpOpCode, httpInPar);
     if (IS_PROFILE(httpProfile)) {
         LOCK();
+        at_timeout = _at_timeout;
+        at_set_timeout(60000);
+        UNLOCK();
 
         switch(httpOpCode) {
             case HTTP_IP_ADDRESS:   // 0
@@ -607,7 +611,8 @@
                 debug_if(_debug_trace_on, "httpSetPar: unknown httpOpCode %d\n", httpOpCode);
                 break;
         }
-
+        LOCK();
+        at_set_timeout(at_timeout);
         UNLOCK();
     }
 
@@ -634,6 +639,7 @@
     if (IS_PROFILE(httpProfile)) {
         LOCK();
         at_timeout = _at_timeout; // Has to be inside LOCK()s
+        UNLOCK();
 
         if (rspFile == NULL) {
             sprintf(defaultFilename + sizeof (defaultFilename) - 2, "%1d", httpProfile);
@@ -663,6 +669,11 @@
                             _at->recv("OK");
                 break;
             case HTTP_POST_FILE:
+#if 1 // For SARA-R5
+                LOCK();
+                at_set_timeout(180*1000);
+                UNLOCK();
+#endif
                 // In this case the parameter sendStr is a filename
                 if (httpContentType != 6) {
                     atSuccess = _at->send("AT+UHTTPC=%d,%d,\"%s\",\"%s\",\"%s\",%d",
@@ -678,6 +689,11 @@
                 }
                 break;
             case HTTP_POST_DATA:
+#if 1 // For SARA-R5
+                LOCK();
+                at_set_timeout(180*1000);
+                UNLOCK();
+#endif
                 // In this case the parameter sendStr is a string containing data
                 if (httpContentType != 6) {
                     atSuccess = _at->send("AT+UHTTPC=%d,%d,\"%s\",\"%s\",\"%s\",%d",
@@ -701,7 +717,9 @@
             Timer timer;
             int read_length = 0;
 
+            LOCK();
             at_set_timeout(1000);
+            UNLOCK();
             _httpProfiles[httpProfile].pending = true;
             _httpProfiles[httpProfile].result = -1;
 
@@ -745,15 +763,14 @@
             }
             timer.stop();
 
+            LOCK();
             at_set_timeout(at_timeout);
+            UNLOCK();
 
             if (!success) {
                 debug_if(_debug_trace_on, "%s: ERROR\n", getHttpCmd(httpCmd));
             }
-
         }
-
-        UNLOCK();
     }
 
     return success ? NULL : &(_httpProfiles[httpProfile].httpError);
--- a/ublox-at-cellular-interface.lib	Mon Jan 06 14:43:04 2020 +0500
+++ b/ublox-at-cellular-interface.lib	Fri Jun 26 10:32:02 2020 +0500
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#69998003d95a
+https://os.mbed.com/users/fahimalavi/code/ublox-at-cellular-interface-SARA-R5/