New cellular update

Dependencies:  

Fork of ublox-at-cellular-interface-ext by u-blox

Revision:
16:a9ffebec6523
Parent:
11:3631f62bb359
Child:
22:46b7bd7979f0
--- a/UbloxATCellularInterfaceExt.cpp	Wed Jun 06 16:40:57 2018 +0500
+++ b/UbloxATCellularInterfaceExt.cpp	Thu Jun 21 15:51:37 2018 +0500
@@ -616,7 +616,7 @@
                                                                               const char *sendStr,
                                                                               int httpContentType,
                                                                               const char *httpCustomPar,
-                                                                              char *buf, int len)
+                                                                              char *buf, int len, int *read_size)
 {
     bool atSuccess = false;
     bool success = false;
@@ -693,6 +693,7 @@
 
         if (atSuccess) {
             Timer timer;
+            int read_length = 0;
 
             at_set_timeout(1000);
             _httpProfiles[httpProfile].pending = true;
@@ -708,8 +709,14 @@
                         // Leave a short delay to make sure the file has been written
                         wait_ms(100);
                         // HTTP command successfully executed
-                        if (readFile(rspFile, buf, len) >= 0) {
+                        read_length = readFile(rspFile, buf, len);
+
+                        if (read_length >= 0) {
                             success = true;
+
+                            if(read_size != NULL) {
+                            	*read_size = *read_size + read_length;
+                            }
                         }
                     } else {
                         // Retrieve the error class and code