diff --git a/src/stkutil.c b/src/stkutil.c index 0e78f543..56fa1029 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -108,11 +108,34 @@ static void destroy_display_text(struct stk_command *command) g_free(command->display_text.text); } +static gboolean parse_dataobj_icon_id(struct comprehension_tlv_iter *iter, + void *user) +{ + struct stk_icon_identifier *id = user; + const unsigned char *data; + + if (comprehension_tlv_iter_get_tag(iter) != + STK_DATA_OBJECT_TYPE_ICON_ID) + return FALSE; + + if (comprehension_tlv_iter_get_length(iter) != 2) + return FALSE; + + data = comprehension_tlv_iter_get_data(iter); + + id->qualifier = data[0]; + id->id = data[1]; + + return TRUE; +} + static dataobj_handler handler_for_type(enum stk_data_object_type type) { switch (type) { case STK_DATA_OBJECT_TYPE_TEXT: return parse_dataobj_text; + case STK_DATA_OBJECT_TYPE_ICON_ID: + return parse_dataobj_icon_id; default: return NULL; }; @@ -188,6 +211,8 @@ static gboolean parse_display_text(struct stk_command *command, ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_TEXT, DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM, &command->display_text.text, + STK_DATA_OBJECT_TYPE_ICON_ID, 0, + &command->display_text.icon_id, STK_DATA_OBJECT_TYPE_INVALID); if (ret == FALSE) diff --git a/src/stkutil.h b/src/stkutil.h index 2664ba52..cc97d978 100644 --- a/src/stkutil.h +++ b/src/stkutil.h @@ -197,8 +197,8 @@ enum stk_duration_type { * ids of 0, we use icon_id with 0 to denote empty icon_identifier objects */ struct stk_icon_identifier { - unsigned char icon_id; - unsigned char icon_qualifier; + unsigned char qualifier; + unsigned char id; }; /*