Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: example-ublox-at-cellular-interface-ext example-ublox-cellular-driver-gen HelloMQTT ublox_new_driver_test ... more
Revision 2:08302b9cd519, committed 2017-06-08
- Comitter:
- rob.meades@u-blox.com
- Date:
- Thu Jun 08 14:40:16 2017 +0100
- Parent:
- 1:458e1b3d460c
- Child:
- 3:027c9eaec52c
- Commit message:
- Set a minimum time limit for readFile() since otherwise very small files will time out.
Changed in this revision
| UbloxCellularDriverGen.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/UbloxCellularDriverGen.cpp Mon Jun 05 14:11:38 2017 +0000
+++ b/UbloxCellularDriverGen.cpp Thu Jun 08 14:40:16 2017 +0100
@@ -669,11 +669,15 @@
// Would use _at->read() here, but if it runs ahead of the
// serial stream it returns -1 instead of the number of characters
// read so far, which is not very helpful so instead use _at->getc() and
- // a time limit. The time limit is twice the amount of time it should take to
- // read the block at the working baud rate
+ // a time limit. The time limit is three times the amount of time it
+ // should take to read the block at the working baud rate with a minimum
+ // of 10 ms (for short files)
timer.reset();
timer.start();
- timeLimit = blockSize * 2 / ((MBED_CONF_UBLOX_CELL_BAUD_RATE / 8) / 1000);
+ timeLimit = blockSize * 3 / ((MBED_CONF_UBLOX_CELL_BAUD_RATE / 8) / 1000);
+ if (timeLimit < 10) {
+ timeLimit = 10;
+ }
sz_read = 0;
while ((sz_read < blockSize) && (timer.read_ms() < timeLimit)) {
ch = _at->getc();
@@ -690,7 +694,8 @@
offset += sz_read;
_at->recv("OK");
} else {
- debug_if(_debug_trace_on, "blockSize %d but only received %d bytes\n", blockSize, sz_read);
+ debug_if(true, "blockSize %d but only received %d bytes within time limit of %d ms\n",
+ blockSize, sz_read, timeLimit);
success = false;
}
} else {