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: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Diff: tests/test_SMS.h
- Revision:
- 19:38794784e009
- Parent:
- 17:2d7c4ea7491b
- Child:
- 39:6e94520a3217
diff -r ad0ca0b1da57 -r 38794784e009 tests/test_SMS.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_SMS.h Mon Dec 16 23:02:22 2013 +0000
@@ -0,0 +1,30 @@
+
+#ifndef _TEST_SMS_H_
+#define _TEST_SMS_H_
+
+void sendSms() {
+ Cellular::Code code;
+ std::string sMsg("Hello from Multi-Tech MBED!");
+ std::string sPhoneNum("16514085259");
+
+ printf("Sending message [%s] to [%s]\r\n", sMsg.c_str(), sPhoneNum.c_str());
+ code = Cellular::getInstance()->sendSMS(sPhoneNum, sMsg);
+
+ if(code != Cellular::OK) {
+ printf("Error during SMS send [%d]\r\n", (int)code);
+ } else {
+ printf("Success!\r\n");
+ }
+}
+
+void receiveSms() {
+ printf("Checking Received Messages\r\n");
+ std::vector<Cellular::Sms> vSms = Cellular::getInstance()->getReceivedSms();
+ printf("\r\n");
+ for(unsigned int i = 0; i < vSms.size(); i++) {
+ printf("[%d][%s][%s][%s]\r\n", i, vSms[i].timestamp.c_str(),
+ vSms[i].phoneNumber.c_str(), vSms[i].message.c_str());
+ }
+}
+
+#endif
uIP Socket Modem Shield (Outdated - see below)