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: GPS_6Axis_DataLogger_SD_UDP
Fork of C027_Support by
Diff: MDM.cpp
- Revision:
- 70:0a87d256cd24
- Parent:
- 69:4d6fa520dfca
- Child:
- 71:041de9a6d93c
diff -r 4d6fa520dfca -r 0a87d256cd24 MDM.cpp
--- a/MDM.cpp Wed May 14 05:54:37 2014 +0000
+++ b/MDM.cpp Wed May 14 09:12:47 2014 +0000
@@ -1011,6 +1011,29 @@
}
// ----------------------------------------------------------------
+
+int MDMParser::_cbCUSD(int type, const char* buf, int len, char* resp)
+{
+ if ((type == TYPE_PLUS) && resp) {
+ // +USD: \"%*[^\"]\",\"%[^\"]\",,\"%*[^\"]\",%d,%d,%d,%d,\"*[^\"]\",%d,%d"..);
+ if (sscanf(buf, "\r\n+CUSD: %*d,\"%[^\"]\",%*d", resp) == 1) {
+ /*nothing*/
+ }
+ }
+ return WAIT;
+}
+
+bool MDMParser::ussdCommand(const char* cmd, char* buf)
+{
+ *buf = '\0';
+ sendFormated("AT+CUSD=1,\"%s\"\r\n",cmd);
+ if (RESP_OK != waitFinalResp(_cbCUSD, buf)) {
+ return false;
+ }
+ return true;
+}
+
+// ----------------------------------------------------------------
void MDMParser::dumpDevStatus(MDMParser::DevStatus* status)
{
@@ -1068,30 +1091,7 @@
if (ip != NOIP)
printf("Modem IP Address: " IPSTR "\r\n", IPNUM(ip));
}
-
-// ----------------------------------------------------------------
-
-int MDMParser::_cbCUSD(int type, const char* buf, int len, char* resp)
-{
- if ((type == TYPE_PLUS) && resp) {
- // +USD: \"%*[^\"]\",\"%[^\"]\",,\"%*[^\"]\",%d,%d,%d,%d,\"*[^\"]\",%d,%d"..);
- if (sscanf(buf, "\r\n+CUSD: %*d,\"%[^\"]\",%*d", resp) == 1) {
- /*nothing*/
- }
- }
- return WAIT;
-}
-
-bool MDMParser::ussdCommand(const char* cmd, char* buf)
-{
- *buf = '\0';
- sendFormated("AT+CUSD=1,\"%s\"\r\n",cmd);
- if (RESP_OK != waitFinalResp(_cbCUSD, buf)) {
- return false;
- }
- return true;
-}
-
+
// ----------------------------------------------------------------
int MDMParser::_parseMatch(Pipe<char>* pipe, int len, const char* sta, const char* end)
{
