From 08e6075437cee1e4a408242e46e27fffda3c514e Mon Sep 17 00:00:00 2001 From: laforge Date: Wed, 28 Mar 2007 11:46:45 +0000 Subject: add parsing of +CMS errors according to GSM 07.05 (Philipp Zabel) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@1529 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/atcmd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c index 11e9251..53a7501 100644 --- a/src/gsmd/atcmd.c +++ b/src/gsmd/atcmd.c @@ -33,6 +33,7 @@ #include "gsmd.h" +#include #include #include #include @@ -50,7 +51,8 @@ enum final_result_codes { static const char *final_results[] = { "OK", "ERROR", - "+CME ERROR:" + "+CME ERROR:", + "+CMS ERROR:", }; /* we basically implement a parse that can deal with @@ -223,6 +225,16 @@ static int ml_parse(const char *buf, int len, void *ctx) final = 1; goto final_cb; } + if (!strncmp(buf+1, "CMS ERROR", 9)) { + /* Part of Case 'C' */ + unsigned long err_nr; + err_nr = strtoul(colon+1, NULL, 10); + DEBUGP("error number %lu\n", err_nr); + if (cmd) + cmd->ret = err_nr; + final = 1; + goto final_cb; + } if (!cmd || strncmp(buf, &cmd->buf[2], colon-buf)) { /* Assuming Case 'B' */ -- cgit v1.2.3