atutil: Parse CMS and CME error codes

This commit is contained in:
Andrzej Zaborowski 2010-08-05 19:30:55 +02:00 committed by Denis Kenzior
parent 8f0b5a13c1
commit 097640d118
1 changed files with 6 additions and 0 deletions

View File

@ -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;