diff options
author | Yang Gu <gyagp0@gmail.com> | 2010-04-22 23:12:25 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-23 11:52:18 -0500 |
commit | e5ce1bb8eb37ba553954e7e520bf37543fbb72c7 (patch) | |
tree | 1d087b1012e7334fea9e7fd418a764d1b4ae4c15 | |
parent | 61d89f7a736de65b63294cdd10b1a5e8f98c2d9b (diff) | |
download | ofono-e5ce1bb8eb37ba553954e7e520bf37543fbb72c7.tar.bz2 |
stkutil: Add parser for mm cid objects
-rw-r--r-- | src/stkutil.c | 20 | ||||
-rw-r--r-- | src/stkutil.h | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/stkutil.c b/src/stkutil.c index c2b3cd52..b4702b28 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -1723,6 +1723,24 @@ static gboolean parse_dataobj_mms_transfer_status( return TRUE; } +/* Defined in TS 102.223 Section 8.85 */ +static gboolean parse_dataobj_mms_content_id( + struct comprehension_tlv_iter *iter, void *user) +{ + struct stk_mms_content_id *mci = user; + const unsigned char *data; + unsigned int len = comprehension_tlv_iter_get_length(iter); + + if (len < 1) + return FALSE; + + data = comprehension_tlv_iter_get_data(iter); + mci->len = len; + memcpy(mci->id, data, len); + + return TRUE; +} + static dataobj_handler handler_for_type(enum stk_data_object_type type) { switch (type) { @@ -1880,6 +1898,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type) return parse_dataobj_mms_id; case STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS: return parse_dataobj_mms_transfer_status; + case STK_DATA_OBJECT_TYPE_MMS_CONTENT_ID: + return parse_dataobj_mms_content_id; default: return NULL; }; diff --git a/src/stkutil.h b/src/stkutil.h index 937bbc6f..267e2967 100644 --- a/src/stkutil.h +++ b/src/stkutil.h @@ -748,6 +748,15 @@ struct stk_mms_transfer_status { unsigned char len; }; +/* + * According to 102.223 Section 8.85 the length of CTLV is 1 byte. This means + * that the maximum size is 127 according to the rules of CTLVs. + */ +struct stk_mms_content_id { + unsigned char id[127]; + unsigned char len; +}; + struct stk_command_display_text { char *text; struct stk_icon_id icon_id; |