--- src/stkutil.c | 21 +++++++++++++++++++++ src/stkutil.h | 11 +++++++++++ 2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c index e6d69ef..0f373f9 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -1480,6 +1480,25 @@ static gboolean parse_dataobj_text_attr(struct comprehension_tlv_iter *iter, return TRUE; } +/* Defined in TS 102.223 Section 8.73 */ +static gboolean parse_dataobj_item_text_attribute_list( + struct comprehension_tlv_iter *iter, void *user) +{ + struct stk_item_text_attribute_list *ital = user; + const unsigned char *data; + unsigned int len = comprehension_tlv_iter_get_length(iter); + + if ((len > sizeof(ital->list)) || (len % 4 != 0)) + return FALSE; + + data = comprehension_tlv_iter_get_data(iter); + + memcpy(ital->list, data, len); + ital->len = len; + + return TRUE; +} + /* Defined in TS 102.223 Section 8.80 */ static gboolean parse_dataobj_frame_id(struct comprehension_tlv_iter *iter, void *user) @@ -1633,6 +1652,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type) return parse_dataobj_cdma_sms_tpdu; case STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE: return parse_dataobj_text_attr; + case STK_DATA_OBJECT_TYPE_ITEM_TEXT_ATTRIBUTE_LIST: + return parse_dataobj_item_text_attribute_list; case STK_DATA_OBJECT_TYPE_FRAME_ID: return parse_dataobj_frame_id; default: diff --git a/src/stkutil.h b/src/stkutil.h index 01597b3..f9cf34b 100644 --- a/src/stkutil.h +++ b/src/stkutil.h @@ -681,6 +681,17 @@ struct stk_text_attribute { unsigned char len; }; +/* + * According to 102.223 Section 8.73 the length of CTLV is 1 byte. This means + * that the maximum size is 127 according to the rules of CTLVs. In addition, + * the length should be also the number multiplied by 4, so the maximum number + * is 124. + */ +struct stk_item_text_attribute_list { + unsigned char list[124]; + unsigned char len; +}; + struct stk_command_display_text { char *text; struct stk_icon_id icon_id; -- 1.7.0.4 _______________________________________________ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono