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.
Fork of MTS-Cellular by
Diff: Cellular/CellularFactory.cpp
- Revision:
- 30:1326b623919a
- Parent:
- 27:ec44d5a9544f
- Child:
- 41:8b9b5098696f
--- a/Cellular/CellularFactory.cpp Wed Jul 02 15:06:03 2014 +0000
+++ b/Cellular/CellularFactory.cpp Mon Jul 14 17:33:24 2014 +0000
@@ -11,7 +11,7 @@
std::string reply;
Cellular::Radio type;
Cellular* cell;
-
+
/* wait for radio to get into a good state */
while (true) {
if (sendCommand(io, "AT", 1000).find("OK") != string::npos) {
@@ -20,14 +20,13 @@
} else {
logTrace("waiting on radio...");
}
-
wait(1);
}
-
+
/* "ATI4" gets us the model (HE910, DE910, etc) */
for (int i = 0; i < 5; i++) {
model = sendCommand(io, "ATI4", 2000);
- if (model.find("error") == string::npos && model.find("ERROR") == string::npos) {
+ if (model.find("error") == string::npos && model.find("ERROR") == string::npos && !model.empty()) {
/* didn't get an error - keep going */
break;
}
