From: Yang Gu Date: Fri, 5 Mar 2010 04:42:00 +0000 (+0800) Subject: Add parser for alpha identifier objects X-Git-Tag: 0.20~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94848b6feb6813c975b12745efe4496f5d63106e;p=platform%2Fupstream%2Fofono.git Add parser for alpha identifier objects --- diff --git a/src/stkutil.c b/src/stkutil.c index e98ad58..22bef30 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -67,6 +67,28 @@ static gboolean parse_dataobj_address(struct comprehension_tlv_iter *iter, return TRUE; } +/* Defined in TS 102.223 Section 8.2 */ +static gboolean parse_dataobj_alpha_identifier( + struct comprehension_tlv_iter *iter, void *user) +{ + char **alpha_id = user; + const unsigned char *data; + unsigned int len; + + if (comprehension_tlv_iter_get_tag(iter) != + STK_DATA_OBJECT_TYPE_ALPHA_IDENTIFIER) + return FALSE; + + len = comprehension_tlv_iter_get_length(iter); + if (len < 1) + return FALSE; + + data = comprehension_tlv_iter_get_data(iter); + *alpha_id = sim_string_to_utf8(data, len); + + return TRUE; +} + /* Described in TS 102.223 Section 8.8 */ static gboolean parse_dataobj_duration(struct comprehension_tlv_iter *iter, void *user) @@ -281,6 +303,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type) switch (type) { case STK_DATA_OBJECT_TYPE_ADDRESS: return parse_dataobj_address; + case STK_DATA_OBJECT_TYPE_ALPHA_IDENTIFIER: + return parse_dataobj_alpha_identifier; case STK_DATA_OBJECT_TYPE_DURATION: return parse_dataobj_duration; case STK_DATA_OBJECT_TYPE_RESPONSE_LENGTH: