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/Cellular.cpp
- Revision:
- 23:8333593dd86f
- Parent:
- 18:fa0d8120f81f
- Child:
- 26:2b769ed8de4f
diff -r c1004a807490 -r 8333593dd86f Cellular/Cellular.cpp
--- a/Cellular/Cellular.cpp Thu Jun 19 14:59:35 2014 +0000
+++ b/Cellular/Cellular.cpp Thu Jun 19 21:24:21 2014 +0000
@@ -273,10 +273,17 @@
string cmd = "AT+CMGS=\"+";
cmd.append(phoneNumber);
cmd.append("\",145");
- string response1 = sendCommand(cmd, 1000);
- if (response1.find('>') == string::npos) {
- logError("CMGS phone number failed");
- return MTS_NO_RESPONSE;
+ for (int i = 0; i < 5; i++) {
+ string response1 = sendCommand(cmd, 1000);
+ if (response1.find('>') != string::npos) {
+ break;
+ }
+ if (i >= 5) {
+ logError("CMGS phone number failed");
+ return MTS_NO_RESPONSE;
+ }
+
+ wait(1);
}
wait(.2);
string response2 = sendCommand(message, 4000, CTRL_Z);
