Fork of ublox-at-cellular-interface to add LARA-R2 support

Dependents:  

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

Files at this revision

API Documentation at this revision

Comitter:
cblack
Date:
Thu Sep 27 15:45:38 2018 -0500
Parent:
18:bfc869299185
Commit message:
Fix to hex mode workaround - read 2x the size in hex mode

Changed in this revision

UbloxATCellularInterface.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r bfc869299185 -r 2e961ce171e6 UbloxATCellularInterface.cpp
--- a/UbloxATCellularInterface.cpp	Wed Sep 26 11:33:31 2018 -0500
+++ b/UbloxATCellularInterface.cpp	Thu Sep 27 15:45:38 2018 -0500
@@ -724,7 +724,7 @@
 #ifdef USE_HEX_MODE_USORx
                     read_sz = 0;
                     char asciiBytes[2];
-                    while (success && (read_sz < usord_sz)) {
+                    while (success && (read_sz < usord_sz*2)) {
                         // Read the 2 bytes of ascii text for this byte of data
                         if (2 == _at->read(asciiBytes, 2)) {
                             read_sz += 2;
@@ -859,7 +859,7 @@
                 // the_data is binary data. I make that 29 + 48 + len(the_data),
                 // so the overhead is 77 bytes.
 
-                _at->debug_on(false); // ABSOLUTELY no time for debug here if you want to
+                //_at->debug_on(false); // ABSOLUTELY no time for debug here if you want to
                 // be able to read packets of any size without
                 // losing characters in UARTSerial
                 if (_at->send("AT+USORF=%d,%d", socket->modem_handle, read_blk) &&
@@ -878,11 +878,10 @@
 #ifdef USE_HEX_MODE_USORx
                     read_sz = 0;
                     char asciiBytes[2];
-                    while (success && (read_sz < usorf_sz)) {
+                    while (success && (read_sz < usorf_sz*2)) {
                         // Read the 2 bytes of ascii text for this byte of data
                         if (2 == _at->read(asciiBytes, 2)) {
                             // convert to binary data and store in read buffer
-                            //tr_debug("%c %c", asciiBytes[0], asciiBytes[1]);
                             sscanf(asciiBytes, "%2hhx", buf+(read_sz/2));
                             read_sz += 2;
                         } else {