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 C027_Support by
Revision 37:cc3433329d66, committed 2014-04-10
- Comitter:
- mazgch
- Date:
- Thu Apr 10 13:44:54 2014 +0000
- Parent:
- 36:c4df7bcf9b6e
- Child:
- 38:e6cab4632d84
- Commit message:
- fix sms parser
Changed in this revision
| MDM.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MDM.cpp Thu Apr 10 13:07:02 2014 +0000
+++ b/MDM.cpp Thu Apr 10 13:44:54 2014 +0000
@@ -180,7 +180,7 @@
int MDMParser::_cbString(int type, const char* buf, int len, char* str)
{
- if (str && (type == TYPE_TEXT)) {
+ if (str && (type == TYPE_UNKNOWN)) {
if (sscanf(buf, "\r\n%s\r\n", str) == 1)
/*nothing*/;
}
@@ -189,7 +189,7 @@
int MDMParser::_cbInt(int type, const char* buf, int len, int* val)
{
- if (val && (type == TYPE_TEXT)) {
+ if (val && (type == TYPE_UNKNOWN)) {
if (sscanf(buf, "\r\n%d\r\n", val) == 1)
/*nothing*/;
}
@@ -332,7 +332,7 @@
int MDMParser::_cbATI(int type, const char* buf, int len, Dev* dev)
{
- if ((type == TYPE_TEXT) && dev) {
+ if ((type == TYPE_UNKNOWN) && dev) {
if (strstr(buf, "SARA-G350")) {
*dev = DEV_SARA_G350;
/*TRACE("Identified Device: SARA-G350 2G\\n")*/;
@@ -858,7 +858,7 @@
if (type == TYPE_PLUS) {
if (sscanf(buf, "\r\n+CMGR: \"%*[^\"]\",\"%[^\"]", param->num) == 1) {
}
- } else if ((type == TYPE_TEXT) && (buf[len-2] == '\r') && (buf[len-1] == '\n')) {
+ } else if ((type == TYPE_UNKNOWN) && (buf[len-2] == '\r') && (buf[len-1] == '\n')) {
memcpy(param->buf, buf, len-2);
param->buf[len-2] = '\0';
}
@@ -993,7 +993,6 @@
{ "\r\n+", "\r\n", TYPE_PLUS },
{ "\r\n@", NULL, TYPE_PROMPT }, // Sockets
{ "\r\n>", NULL, TYPE_PROMPT }, // SMS
- { "\r\n", "\r\n", TYPE_TEXT },
};
for (int i = 0; i < sizeof(lutF)/sizeof(*lutF); i ++) {
pipe->set(unkn);
