mirror of git://git.sysmocom.de/ofono
atmodem: Add utility for parsing CMTI/CDSI/CBMI
This commit is contained in:
parent
5a883d1c76
commit
1b36d1cd43
|
@ -287,3 +287,43 @@ out:
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean at_util_parse_sms_index_delivery(GAtResult *result, const char *prefix,
|
||||
enum at_util_sms_store *out_st,
|
||||
int *out_index)
|
||||
{
|
||||
GAtResultIter iter;
|
||||
const char *strstore;
|
||||
enum at_util_sms_store st;
|
||||
int index;
|
||||
|
||||
g_at_result_iter_init(&iter, result);
|
||||
|
||||
if (!g_at_result_iter_next(&iter, prefix))
|
||||
return FALSE;
|
||||
|
||||
if (!g_at_result_iter_next_string(&iter, &strstore))
|
||||
return FALSE;
|
||||
|
||||
if (g_str_equal(strstore, "ME"))
|
||||
st = AT_UTIL_SMS_STORE_ME;
|
||||
else if (g_str_equal(strstore, "SM"))
|
||||
st = AT_UTIL_SMS_STORE_SM;
|
||||
else if (g_str_equal(strstore, "SR"))
|
||||
st = AT_UTIL_SMS_STORE_SR;
|
||||
else if (g_str_equal(strstore, "BM"))
|
||||
st = AT_UTIL_SMS_STORE_BM;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
if (!g_at_result_iter_next_number(&iter, &index))
|
||||
return FALSE;
|
||||
|
||||
if (out_index)
|
||||
*out_index = index;
|
||||
|
||||
if (out_st)
|
||||
*out_st = st;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,14 @@
|
|||
*
|
||||
*/
|
||||
|
||||
enum at_util_sms_store {
|
||||
AT_UTIL_SMS_STORE_SM = 0,
|
||||
AT_UTIL_SMS_STORE_ME = 1,
|
||||
AT_UTIL_SMS_STORE_MT = 2,
|
||||
AT_UTIL_SMS_STORE_SR = 3,
|
||||
AT_UTIL_SMS_STORE_BM = 4,
|
||||
};
|
||||
|
||||
void decode_at_error(struct ofono_error *error, const char *final);
|
||||
gint at_util_call_compare_by_status(gconstpointer a, gconstpointer b);
|
||||
gint at_util_call_compare_by_phone_number(gconstpointer a, gconstpointer b);
|
||||
|
@ -34,6 +42,10 @@ gboolean at_util_parse_reg_unsolicited(GAtResult *result, const char *prefix,
|
|||
int *ci, int *tech,
|
||||
unsigned int vendor);
|
||||
|
||||
gboolean at_util_parse_sms_index_delivery(GAtResult *result, const char *prefix,
|
||||
enum at_util_sms_store *store,
|
||||
int *index);
|
||||
|
||||
struct cb_data {
|
||||
void *cb;
|
||||
void *data;
|
||||
|
|
Loading…
Reference in New Issue