diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2010-08-05 19:30:55 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-08-06 12:04:28 -0500 |
commit | 097640d118ae33081cfb69c3599f0bbf84f88df5 (patch) | |
tree | bb11c26cf8589a3d151cd30b7846060a788c80dc | |
parent | 8f0b5a13c1e8a2319e9f83eacf556fa7579cffb8 (diff) | |
download | ofono-097640d118ae33081cfb69c3599f0bbf84f88df5.tar.bz2 |
atutil: Parse CMS and CME error codes
-rw-r--r-- | drivers/atmodem/atutil.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index 5dad679b..e668602e 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -40,6 +40,12 @@ void decode_at_error(struct ofono_error *error, const char *final) if (!strcmp(final, "OK")) { error->type = OFONO_ERROR_TYPE_NO_ERROR; error->error = 0; + } else if (g_str_has_prefix(final, "+CMS ERROR:")) { + error->type = OFONO_ERROR_TYPE_CMS; + error->error = strtol(&final[11], NULL, 0); + } else if (g_str_has_prefix(final, "+CME ERROR:")) { + error->type = OFONO_ERROR_TYPE_CME; + error->error = strtol(&final[11], NULL, 0); } else { error->type = OFONO_ERROR_TYPE_FAILURE; error->error = 0; |