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 36:948d06b3e23c, committed 2014-07-23
- Comitter:
- Vanger
- Date:
- Wed Jul 23 15:44:54 2014 +0000
- Parent:
- 35:257eb41405e1
- Child:
- 37:14f819beeccf
- Commit message:
- Changed SMS format to only add preceding '+' to UIP radio types in Cellular.cpp, and added case of ERROR to AT+CMGS result.
Changed in this revision
| Cellular/Cellular.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Test/TestSMS.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Cellular/Cellular.cpp Mon Jul 21 20:14:18 2014 +0000
+++ b/Cellular/Cellular.cpp Wed Jul 23 15:44:54 2014 +0000
@@ -269,8 +269,12 @@
return code;
}
string cmd = "AT+CMGS=\"";
+ //EasyIP radios do not include the +
+ if(type == MTSMC_H5_IP || type == MTSMC_EV3_IP || type ++ MTSMC_C2_IP) {
+ cmd.append("+");
+ }
cmd.append(phoneNumber);
- cmd.append("\"");
+ cmd.append("\",145");
for (int i = 0; i < 5; i++) {
string response1 = sendCommand(cmd, 1000);
if (response1.find('>') != string::npos) {
@@ -286,7 +290,7 @@
wait(.2);
string response2 = sendCommand(message, 4000, CTRL_Z);
logInfo("SMS Response: [%s]", response2.c_str());
- if (response2.find("+CMGS:") == string::npos) {
+ if ((response2.find("+CMGS:") == string::npos) || (response2.find("ERROR") != std::string::npos)) {
logError("CMGS message failed");
return MTS_FAILURE;
}
--- a/Test/TestSMS.h Mon Jul 21 20:14:18 2014 +0000
+++ b/Test/TestSMS.h Wed Jul 23 15:44:54 2014 +0000
@@ -22,7 +22,7 @@
TestSMS::TestSMS() : TestCollection("TestSMS") {}
void TestSMS::run() {
- const char APN[] = "b2b.tmobile.com";
+ const char APN[] = "";
string number;
string response;
