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
Revision 55:85c04afa939a, committed 2014-08-11
- Comitter:
- Vanger
- Date:
- Mon Aug 11 21:01:50 2014 +0000
- Parent:
- 54:a6c738bfc391
- Child:
- 56:43205bd2752a
- Commit message:
- Changed sendSMS() in Cellular.cpp to only send message for sms once, and just increased the timeout for the AT command to send the SMS content. Also determined that G3 radio type AT+CSMP format.
Changed in this revision
| Cellular/Cellular.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Cellular/Cellular.cpp Mon Aug 11 19:54:54 2014 +0000
+++ b/Cellular/Cellular.cpp Mon Aug 11 21:01:50 2014 +0000
@@ -251,11 +251,10 @@
{
string csmp;
- if (type == MTSMC_H5_IP || type == MTSMC_H5) {
+ if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3) {
csmp = "AT+CSMP=17,167,0,0";
} else if (type == MTSMC_EV3_IP || type == MTSMC_EV3 || type == MTSMC_C2_IP || type == MTSMC_C2) {
csmp = "AT+CSMP=,4098,0,2";
- } else if (type == MTSMC_G3) {
} else {
logError("unknown radio type [%d]", type);
return MTS_FAILURE;
@@ -290,17 +289,12 @@
}
wait(.2);
- for (int i = 0; i < 5; i++) {
- string response2 = sendCommand(message, 4000, CTRL_Z);
- if (response2.find("+CMGS:") != string::npos) {
- break;
- }
- if (i >= 5) {
- logError("CMGS message failed");
- return MTS_FAILURE;
- }
- wait(1);
+ string response2 = sendCommand(message, 12000, CTRL_Z);
+ if (response2.find("+CMGS:") == string::npos) {
+ logError("CMGS message failed");
+ return MTS_FAILURE;
}
+
return MTS_SUCCESS;
}
