All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/27] stk: Add poll interval proactive command parser
@ 2010-05-13 10:48 Yang Gu
  2010-05-13 10:48 ` [PATCH 02/27] test-stkutil: Add test for poll interval parser Yang Gu
                   ` (26 more replies)
  0 siblings, 27 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]

---
 src/stkutil.c |   28 ++++++++++++++++++++++++++++
 src/stkutil.h |    5 +++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 7d89a63..46f4796 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2230,6 +2230,31 @@ static gboolean parse_play_tone(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_poll_interval(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_poll_interval *obj = &command->poll_interval;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_DURATION,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->duration,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	command->destructor = NULL;
+
+	return TRUE;
+}
+
 static void destroy_send_sms(struct stk_command *command)
 {
 	g_free(command->send_sms.alpha_id);
@@ -2358,6 +2383,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_PLAY_TONE:
 		ok = parse_play_tone(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_POLL_INTERVAL:
+		ok = parse_poll_interval(command, &iter);
+		break;
 	case STK_COMMAND_TYPE_SEND_SMS:
 		ok = parse_send_sms(command, &iter);
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 2d34ca4..02451b4 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -824,6 +824,10 @@ struct stk_command_play_tone {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_poll_interval {
+	struct stk_duration duration;
+};
+
 struct stk_command_send_sms {
 	char *alpha_id;
 	struct stk_address address;
@@ -847,6 +851,7 @@ struct stk_command {
 		struct stk_command_get_input get_input;
 		struct stk_command_play_tone play_tone;
 		struct stk_command_send_sms send_sms;
+		struct stk_command_poll_interval poll_interval;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 02/27] test-stkutil: Add test for poll interval parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 03/27] stkutil: Add setup menu proactive command parser Yang Gu
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2061 bytes --]

---
 unit/test-stkutil.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 1b24df3..4cce0f5 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -3883,6 +3883,49 @@ static void test_play_tone(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct poll_interval_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	struct stk_duration duration;
+};
+
+static unsigned char poll_interval_111[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x03,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x84, 0x02, 0x01, 0x14 };
+
+static struct poll_interval_test poll_interval_data_111 = {
+	.pdu = poll_interval_111,
+	.pdu_len = sizeof(poll_interval_111),
+	.qualifier = 0x00,
+	.duration = {
+		.unit = STK_DURATION_TYPE_SECONDS,
+		.interval = 20
+	}
+};
+
+/* Defined in TS 102.384 Section 27.22.4.6 */
+static void test_poll_interval(gconstpointer data)
+{
+	const struct poll_interval_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_POLL_INTERVAL);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	check_duration(&command->poll_interval.duration, &test->duration);
+
+	stk_command_free(command);
+}
+
 struct send_sms_test {
 	const unsigned char *pdu;
 	unsigned int pdu_len;
@@ -4321,6 +4364,9 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Play Tone 6.1.3",
 				&play_tone_data_613, test_play_tone);
 
+	g_test_add_data_func("/teststk/Poll Interval 1.1.1",
+				&poll_interval_data_111, test_poll_interval);
+
 	g_test_add_data_func("/teststk/Send SMS 1.1",
 				&send_sms_data_11, test_send_sms);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 03/27] stkutil: Add setup menu proactive command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
  2010-05-13 10:48 ` [PATCH 02/27] test-stkutil: Add test for poll interval parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 04/27] test-stkutil: Add test for setup menu parser Yang Gu
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 7200 bytes --]

---
 src/simutil.c |   12 +++++
 src/simutil.h |    3 +
 src/stkutil.c |  138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 src/stkutil.h |   11 +++++
 4 files changed, 160 insertions(+), 4 deletions(-)

diff --git a/src/simutil.c b/src/simutil.c
index 941c551..b98c011 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -307,6 +307,18 @@ const unsigned char *comprehension_tlv_iter_get_data(
 	return iter->data;
 }
 
+void comprehension_tlv_iter_copy(struct comprehension_tlv_iter *from,
+					struct comprehension_tlv_iter *to)
+{
+	to->max = from->max;
+	to->pos = from->pos;
+	to->pdu = from->pdu;
+	to->tag = from->tag;
+	to->cr = from->cr;
+	to->len = from->len;
+	to->data = from->data;
+}
+
 void ber_tlv_iter_init(struct ber_tlv_iter *iter, const unsigned char *pdu,
 			unsigned int len)
 {
diff --git a/src/simutil.h b/src/simutil.h
index 7590cca..45b6847 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -132,6 +132,9 @@ unsigned int comprehension_tlv_iter_get_length(
 const unsigned char *comprehension_tlv_iter_get_data(
 					struct comprehension_tlv_iter *iter);
 
+void comprehension_tlv_iter_copy(struct comprehension_tlv_iter *from,
+					struct comprehension_tlv_iter *to);
+
 void ber_tlv_iter_init(struct ber_tlv_iter *iter, const unsigned char *pdu,
 			unsigned int len);
 /*
diff --git a/src/stkutil.c b/src/stkutil.c
index 46f4796..1698321 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -281,8 +281,8 @@ static gboolean parse_dataobj_alpha_id(struct comprehension_tlv_iter *iter,
 	char *utf8;
 
 	len = comprehension_tlv_iter_get_length(iter);
-	if (len < 1)
-		return FALSE;
+	if (len == 0)
+		return TRUE;
 
 	data = comprehension_tlv_iter_get_data(iter);
 	utf8 = sim_string_to_utf8(data, len);
@@ -373,7 +373,11 @@ static gboolean parse_dataobj_item(struct comprehension_tlv_iter *iter,
 	char *utf8;
 
 	len = comprehension_tlv_iter_get_length(iter);
-	if (len < 2)
+
+	if (len == 0)
+		return TRUE;
+
+	if (len == 1)
 		return FALSE;
 
 	data = comprehension_tlv_iter_get_data(iter);
@@ -2022,7 +2026,6 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter,
 		entries = g_slist_prepend(entries, entry);
 	}
 
-
 	if (comprehension_tlv_iter_next(iter) != TRUE)
 		goto out;
 
@@ -2039,6 +2042,10 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter,
 		if (comprehension_tlv_iter_get_tag(iter) == entry->type) {
 			if (handler(iter, entry->data))
 				entry->parsed = TRUE;
+
+			if (l->next == NULL)
+				break;
+
 			if (comprehension_tlv_iter_next(iter) == FALSE)
 				break;
 		}
@@ -2255,6 +2262,126 @@ static gboolean parse_poll_interval(struct stk_command *command,
 	return TRUE;
 }
 
+static void destroy_stk_item(struct stk_item *item)
+{
+	g_free(item->text);
+	g_free(item);
+}
+
+static void destroy_setup_menu(struct stk_command *command)
+{
+	g_free(command->setup_menu.alpha_id);
+	g_slist_foreach(command->setup_menu.items,
+				(GFunc)destroy_stk_item, NULL);
+	g_slist_free(command->setup_menu.items);
+}
+
+static gboolean parse_list(struct comprehension_tlv_iter *iter,
+		enum stk_data_object_type type,	int flags, GSList **list)
+{
+	struct comprehension_tlv_iter iter_old;
+	void *dataobj;
+	gboolean has_obj = FALSE;
+	dataobj_handler handler = handler_for_type(type);
+	gboolean ret;
+
+	if ((type != STK_DATA_OBJECT_TYPE_ITEM) && (type !=
+			STK_DATA_OBJECT_TYPE_PROVISIONING_FILE_REFERENCE))
+		return FALSE;
+
+	comprehension_tlv_iter_copy(iter, &iter_old);
+
+	while (comprehension_tlv_iter_next(iter)) {
+		if (comprehension_tlv_iter_get_tag(iter) != type)
+			break;
+
+		comprehension_tlv_iter_copy(iter, &iter_old);
+
+		if (type == STK_DATA_OBJECT_TYPE_ITEM)
+			dataobj = g_try_new0(struct stk_item, 1);
+		else
+			dataobj = g_try_new0(struct stk_file, 1);
+
+		if (!dataobj)
+			goto out;
+
+		ret = handler(iter, dataobj);
+		has_obj |= ret;
+
+		if (type == STK_DATA_OBJECT_TYPE_ITEM) {
+			struct stk_item *item = dataobj;
+
+			/* either return is FALSE or item is empty */
+			if (item->id == 0)
+				g_free(dataobj);
+			else
+				*list = g_slist_prepend(*list, dataobj);
+		} else
+			*list = g_slist_prepend(*list, dataobj);
+	}
+
+	comprehension_tlv_iter_copy(&iter_old, iter);
+out:
+	if ((flags & DATAOBJ_FLAG_MANDATORY) && !has_obj)
+		return FALSE;
+
+	*list = g_slist_reverse(*list);
+
+	return TRUE;
+}
+
+static gboolean parse_setup_menu(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_setup_menu *obj = &command->setup_menu;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		goto error;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		goto error;
+
+	ret = parse_dataobj(iter,
+			STK_DATA_OBJECT_TYPE_ALPHA_ID,
+			DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+			&obj->alpha_id,
+			STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		goto error;
+
+	ret = parse_list(iter, STK_DATA_OBJECT_TYPE_ITEM,
+				DATAOBJ_FLAG_MANDATORY, &obj->items);
+
+	if (ret == FALSE)
+		goto error;
+
+	ret = parse_dataobj(iter,
+			STK_DATA_OBJECT_TYPE_ITEMS_NEXT_ACTION_INDICATOR, 0,
+			&obj->next_act,
+			STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+			&obj->icon_id,
+			STK_DATA_OBJECT_TYPE_ITEM_ICON_ID_LIST, 0,
+			&obj->item_icon_id_list,
+			STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+			&obj->text_attr,
+			STK_DATA_OBJECT_TYPE_ITEM_TEXT_ATTRIBUTE_LIST, 0,
+			&obj->item_text_attr_list,
+			STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		goto error;
+
+	command->destructor = destroy_setup_menu;
+
+	return TRUE;
+
+error:
+	destroy_setup_menu(command);
+	return FALSE;
+}
+
 static void destroy_send_sms(struct stk_command *command)
 {
 	g_free(command->send_sms.alpha_id);
@@ -2386,6 +2513,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_POLL_INTERVAL:
 		ok = parse_poll_interval(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_SETUP_MENU:
+		ok = parse_setup_menu(command, &iter);
+		break;
 	case STK_COMMAND_TYPE_SEND_SMS:
 		ok = parse_send_sms(command, &iter);
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 02451b4..e22292b 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -828,6 +828,16 @@ struct stk_command_poll_interval {
 	struct stk_duration duration;
 };
 
+struct stk_command_setup_menu {
+	char *alpha_id;
+	GSList *items;
+	struct stk_items_next_action_indicator next_act;
+	struct stk_icon_id icon_id;
+	struct stk_item_icon_id_list item_icon_id_list;
+	struct stk_text_attribute text_attr;
+	struct stk_item_text_attribute_list item_text_attr_list;
+};
+
 struct stk_command_send_sms {
 	char *alpha_id;
 	struct stk_address address;
@@ -852,6 +862,7 @@ struct stk_command {
 		struct stk_command_play_tone play_tone;
 		struct stk_command_send_sms send_sms;
 		struct stk_command_poll_interval poll_interval;
+		struct stk_command_setup_menu setup_menu;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 04/27] test-stkutil: Add test for setup menu parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
  2010-05-13 10:48 ` [PATCH 02/27] test-stkutil: Add test for poll interval parser Yang Gu
  2010-05-13 10:48 ` [PATCH 03/27] stkutil: Add setup menu proactive command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 05/27] stkutil: Add select item proactive command parser Yang Gu
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 47915 bytes --]

---
 unit/test-stkutil.c | 1616 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1616 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 4cce0f5..dc33183 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -35,6 +35,8 @@
 #include "smsutil.h"
 #include "stkutil.h"
 
+#define MAX_ITEM 100
+
 static gboolean g_mem_equal(const unsigned char *v1, const unsigned char *v2,
 				unsigned int len)
 {
@@ -77,6 +79,28 @@ static void check_duration(const struct stk_duration *command,
 	g_assert(command->interval == test->interval);
 }
 
+/* Defined in TS 102.223 Section 8.9 */
+static void check_item(const struct stk_item *command,
+					const struct stk_item *test)
+{
+	g_assert(command->id == test->id);
+	g_assert(g_str_equal(command->text, test->text));
+}
+
+static void check_items(GSList *command, const struct stk_item *test)
+{
+	struct stk_item *si;
+	GSList *l;
+	unsigned int i = 0;
+
+	for (l = command; l; l = l->next) {
+		si = l->data;
+		check_item(si, &test[i++]);
+	}
+
+	g_assert(test[i].id == 0);
+}
+
 /* Defined in TS 102.223 Section 8.11 */
 static void check_response_length(const struct stk_response_length *command,
 					const struct stk_response_length *test)
@@ -85,6 +109,15 @@ static void check_response_length(const struct stk_response_length *command,
 	g_assert(command->max == test->max);
 }
 
+/* Defined in TS 102.223 Section 8.24 */
+static void check_items_next_action_indicator(
+			const struct stk_items_next_action_indicator *command,
+			const struct stk_items_next_action_indicator *test)
+{
+	g_assert(command->len == test->len);
+	g_assert(g_mem_equal(command->list, test->list, test->len));
+}
+
 /* Defined in TS 102.223 Section 8.31 */
 static void check_icon_id(const struct stk_icon_id *command,
 					const struct stk_icon_id *test)
@@ -93,6 +126,15 @@ static void check_icon_id(const struct stk_icon_id *command,
 	g_assert(command->qualifier == test->qualifier);
 }
 
+/* Defined in TS 102.223 Section 8.32 */
+static void check_item_icon_id_list(const struct stk_item_icon_id_list *command,
+				const struct stk_item_icon_id_list *test)
+{
+	g_assert(command->qualifier == test->qualifier);
+	g_assert(command->len == test->len);
+	g_assert(g_mem_equal(command->list, test->list, test->len));
+}
+
 /* Defined in TS 102.223 Section 8.72 */
 static void check_text_attr(const struct stk_text_attribute *command,
 					const struct stk_text_attribute *test)
@@ -101,6 +143,15 @@ static void check_text_attr(const struct stk_text_attribute *command,
 	g_assert(g_mem_equal(command->attributes, test->attributes, test->len));
 }
 
+/* Defined in TS 102.223 Section 8.73 */
+static void check_item_text_attribute_list(
+			const struct stk_item_text_attribute_list *command,
+			const struct stk_item_text_attribute_list *test)
+{
+	g_assert(command->len == test->len);
+	g_assert(g_mem_equal(command->list, test->list, test->len));
+}
+
 /* Defined in TS 102.223 Section 8.80 */
 static void check_frame_id(const struct stk_frame_id *command,
 					const struct stk_frame_id *test)
@@ -3926,6 +3977,1500 @@ static void test_poll_interval(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct setup_menu_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	char *alpha_id;
+	struct stk_item items[MAX_ITEM];
+	struct stk_items_next_action_indicator next_act;
+	struct stk_icon_id icon_id;
+	struct stk_item_icon_id_list item_icon_id_list;
+	struct stk_text_attribute text_attr;
+	struct stk_item_text_attribute_list item_text_attr_list;
+};
+
+static unsigned char setup_menu_111[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32, 0x8F, 0x07, 0x03,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x33, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34 };
+
+static unsigned char setup_menu_112[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x04, 0x11, 0x4F, 0x6E, 0x65,
+						0x8F, 0x04, 0x12, 0x54, 0x77,
+						0x6F };
+
+static unsigned char setup_menu_113[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x00, 0x8F, 0x00 };
+
+static unsigned char setup_menu_121[] = { 0xD0, 0x81, 0xFC, 0x81, 0x03, 0x01,
+						0x25, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x0A, 0x4C, 0x61,
+						0x72, 0x67, 0x65, 0x4D, 0x65,
+						0x6E, 0x75, 0x31, 0x8F, 0x05,
+						0x50, 0x5A, 0x65, 0x72, 0x6F,
+						0x8F, 0x04, 0x4F, 0x4F, 0x6E,
+						0x65, 0x8F, 0x04, 0x4E, 0x54,
+						0x77, 0x6F, 0x8F, 0x06, 0x4D,
+						0x54, 0x68, 0x72, 0x65, 0x65,
+						0x8F, 0x05, 0x4C, 0x46, 0x6F,
+						0x75, 0x72, 0x8F, 0x05, 0x4B,
+						0x46, 0x69, 0x76, 0x65, 0x8F,
+						0x04, 0x4A, 0x53, 0x69, 0x78,
+						0x8F, 0x06, 0x49, 0x53, 0x65,
+						0x76, 0x65, 0x6E, 0x8F, 0x06,
+						0x48, 0x45, 0x69, 0x67, 0x68,
+						0x74, 0x8F, 0x05, 0x47, 0x4E,
+						0x69, 0x6E, 0x65, 0x8F, 0x06,
+						0x46, 0x41, 0x6C, 0x70, 0x68,
+						0x61, 0x8F, 0x06, 0x45, 0x42,
+						0x72, 0x61, 0x76, 0x6F, 0x8F,
+						0x08, 0x44, 0x43, 0x68, 0x61,
+						0x72, 0x6C, 0x69, 0x65, 0x8F,
+						0x06, 0x43, 0x44, 0x65, 0x6C,
+						0x74, 0x61, 0x8F, 0x05, 0x42,
+						0x45, 0x63, 0x68, 0x6F, 0x8F,
+						0x09, 0x41, 0x46, 0x6F, 0x78,
+						0x2D, 0x74, 0x72, 0x6F, 0x74,
+						0x8F, 0x06, 0x40, 0x42, 0x6C,
+						0x61, 0x63, 0x6B, 0x8F, 0x06,
+						0x3F, 0x42, 0x72, 0x6F, 0x77,
+						0x6E, 0x8F, 0x04, 0x3E, 0x52,
+						0x65, 0x64, 0x8F, 0x07, 0x3D,
+						0x4F, 0x72, 0x61, 0x6E, 0x67,
+						0x65, 0x8F, 0x07, 0x3C, 0x59,
+						0x65, 0x6C, 0x6C, 0x6F, 0x77,
+						0x8F, 0x06, 0x3B, 0x47, 0x72,
+						0x65, 0x65, 0x6E, 0x8F, 0x05,
+						0x3A, 0x42, 0x6C, 0x75, 0x65,
+						0x8F, 0x07, 0x39, 0x56, 0x69,
+						0x6F, 0x6C, 0x65, 0x74, 0x8F,
+						0x05, 0x38, 0x47, 0x72, 0x65,
+						0x79, 0x8F, 0x06, 0x37, 0x57,
+						0x68, 0x69, 0x74, 0x65, 0x8F,
+						0x06, 0x36, 0x6D, 0x69, 0x6C,
+						0x6C, 0x69, 0x8F, 0x06, 0x35,
+						0x6D, 0x69, 0x63, 0x72, 0x6F,
+						0x8F, 0x05, 0x34, 0x6E, 0x61,
+						0x6E, 0x6F, 0x8F, 0x05, 0x33,
+						0x70, 0x69, 0x63, 0x6F };
+
+static unsigned char setup_menu_122[] = { 0xD0, 0x81, 0xF3, 0x81, 0x03, 0x01,
+						0x25, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x0A, 0x4C, 0x61,
+						0x72, 0x67, 0x65, 0x4D, 0x65,
+						0x6E, 0x75, 0x32, 0x8F, 0x1D,
+						0xFF, 0x31, 0x20, 0x43, 0x61,
+						0x6C, 0x6C, 0x20, 0x46, 0x6F,
+						0x72, 0x77, 0x61, 0x72, 0x64,
+						0x20, 0x55, 0x6E, 0x63, 0x6F,
+						0x6E, 0x64, 0x69, 0x74, 0x69,
+						0x6F, 0x6E, 0x61, 0x6C, 0x8F,
+						0x1C, 0xFE, 0x32, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x20, 0x46,
+						0x6F, 0x72, 0x77, 0x61, 0x72,
+						0x64, 0x20, 0x4F, 0x6E, 0x20,
+						0x55, 0x73, 0x65, 0x72, 0x20,
+						0x42, 0x75, 0x73, 0x79, 0x8F,
+						0x1B, 0xFD, 0x33, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x20, 0x46,
+						0x6F, 0x72, 0x77, 0x61, 0x72,
+						0x64, 0x20, 0x4F, 0x6E, 0x20,
+						0x4E, 0x6F, 0x20, 0x52, 0x65,
+						0x70, 0x6C, 0x79, 0x8F, 0x25,
+						0xFC, 0x34, 0x20, 0x43, 0x61,
+						0x6C, 0x6C, 0x20, 0x46, 0x6F,
+						0x72, 0x77, 0x61, 0x72, 0x64,
+						0x20, 0x4F, 0x6E, 0x20, 0x55,
+						0x73, 0x65, 0x72, 0x20, 0x4E,
+						0x6F, 0x74, 0x20, 0x52, 0x65,
+						0x61, 0x63, 0x68, 0x61, 0x62,
+						0x6C, 0x65, 0x8F, 0x20, 0xFB,
+						0x35, 0x20, 0x42, 0x61, 0x72,
+						0x72, 0x69, 0x6E, 0x67, 0x20,
+						0x4F, 0x66, 0x20, 0x41, 0x6C,
+						0x6C, 0x20, 0x4F, 0x75, 0x74,
+						0x67, 0x6F, 0x69, 0x6E, 0x67,
+						0x20, 0x43, 0x61, 0x6C, 0x6C,
+						0x73, 0x8F, 0x24, 0xFA, 0x36,
+						0x20, 0x42, 0x61, 0x72, 0x72,
+						0x69, 0x6E, 0x67, 0x20, 0x4F,
+						0x66, 0x20, 0x41, 0x6C, 0x6C,
+						0x20, 0x4F, 0x75, 0x74, 0x67,
+						0x6F, 0x69, 0x6E, 0x67, 0x20,
+						0x49, 0x6E, 0x74, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x73, 0x8F,
+						0x13, 0xF9, 0x37, 0x20, 0x43,
+						0x4C, 0x49, 0x20, 0x50, 0x72,
+						0x65, 0x73, 0x65, 0x6E, 0x74,
+						0x61, 0x74, 0x69, 0x6F, 0x6E };
+
+static unsigned char setup_menu_123[] = { 0xD0, 0x81, 0xFC, 0x81, 0x03, 0x01,
+						0x25, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x81, 0xEC, 0x54,
+						0x68, 0x65, 0x20, 0x53, 0x49,
+						0x4D, 0x20, 0x73, 0x68, 0x61,
+						0x6C, 0x6C, 0x20, 0x73, 0x75,
+						0x70, 0x70, 0x6C, 0x79, 0x20,
+						0x61, 0x20, 0x73, 0x65, 0x74,
+						0x20, 0x6F, 0x66, 0x20, 0x6D,
+						0x65, 0x6E, 0x75, 0x20, 0x69,
+						0x74, 0x65, 0x6D, 0x73, 0x2C,
+						0x20, 0x77, 0x68, 0x69, 0x63,
+						0x68, 0x20, 0x73, 0x68, 0x61,
+						0x6C, 0x6C, 0x20, 0x62, 0x65,
+						0x20, 0x69, 0x6E, 0x74, 0x65,
+						0x67, 0x72, 0x61, 0x74, 0x65,
+						0x64, 0x20, 0x77, 0x69, 0x74,
+						0x68, 0x20, 0x74, 0x68, 0x65,
+						0x20, 0x6D, 0x65, 0x6E, 0x75,
+						0x20, 0x73, 0x79, 0x73, 0x74,
+						0x65, 0x6D, 0x20, 0x28, 0x6F,
+						0x72, 0x20, 0x6F, 0x74, 0x68,
+						0x65, 0x72, 0x20, 0x4D, 0x4D,
+						0x49, 0x20, 0x66, 0x61, 0x63,
+						0x69, 0x6C, 0x69, 0x74, 0x79,
+						0x29, 0x20, 0x69, 0x6E, 0x20,
+						0x6F, 0x72, 0x64, 0x65, 0x72,
+						0x20, 0x74, 0x6F, 0x20, 0x67,
+						0x69, 0x76, 0x65, 0x20, 0x74,
+						0x68, 0x65, 0x20, 0x75, 0x73,
+						0x65, 0x72, 0x20, 0x74, 0x68,
+						0x65, 0x20, 0x6F, 0x70, 0x70,
+						0x6F, 0x72, 0x74, 0x75, 0x6E,
+						0x69, 0x74, 0x79, 0x20, 0x74,
+						0x6F, 0x20, 0x63, 0x68, 0x6F,
+						0x6F, 0x73, 0x65, 0x20, 0x6F,
+						0x6E, 0x65, 0x20, 0x6F, 0x66,
+						0x20, 0x74, 0x68, 0x65, 0x73,
+						0x65, 0x20, 0x6D, 0x65, 0x6E,
+						0x75, 0x20, 0x69, 0x74, 0x65,
+						0x6D, 0x73, 0x20, 0x61, 0x74,
+						0x20, 0x68, 0x69, 0x73, 0x20,
+						0x6F, 0x77, 0x6E, 0x20, 0x64,
+						0x69, 0x73, 0x63, 0x72, 0x65,
+						0x74, 0x69, 0x6F, 0x6E, 0x2E,
+						0x20, 0x45, 0x61, 0x63, 0x68,
+						0x20, 0x69, 0x74, 0x65, 0x6D,
+						0x20, 0x63, 0x6F, 0x6D, 0x70,
+						0x72, 0x69, 0x73, 0x65, 0x73,
+						0x20, 0x61, 0x20, 0x73, 0x68,
+						0x8F, 0x02, 0x01, 0x59 };
+
+static unsigned char setup_menu_211[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x25,
+						0x80, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32, 0x8F, 0x07, 0x03,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x33, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34 };
+
+static unsigned char setup_menu_311[] = { 0xD0, 0x41, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32, 0x8F, 0x07, 0x03,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x33, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34,
+						0x18, 0x04, 0x13, 0x10, 0x15,
+						0x26 };
+
+static unsigned char setup_menu_411[] = { 0xD0, 0x3C, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32, 0x8F, 0x07, 0x03,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x33, 0x9E, 0x02, 0x01, 0x01,
+						0x9F, 0x04, 0x01, 0x05, 0x05,
+						0x05 };
+
+static unsigned char setup_menu_421[] = { 0xD0, 0x3C, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32, 0x8F, 0x07, 0x03,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x33, 0x9E, 0x02, 0x00, 0x01,
+						0x9F, 0x04, 0x00, 0x05, 0x05,
+						0x05 };
+
+static unsigned char setup_menu_511[] = { 0xD0, 0x29, 0x81, 0x03, 0x01, 0x25,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32 };
+
+static unsigned char setup_menu_611[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x00, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x00, 0xB4,
+						0x00, 0x06, 0x00, 0xB4, 0x00,
+						0x06, 0x00, 0xB4 };
+
+static unsigned char setup_menu_612[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x32, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34,
+						0x8F, 0x07, 0x05, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x35, 0x8F,
+						0x07, 0x06, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x36 };
+
+static unsigned char setup_menu_621[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x01, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x01, 0xB4,
+						0x00, 0x06, 0x01, 0xB4, 0x00,
+						0x06, 0x01, 0xB4 };
+
+static unsigned char setup_menu_622[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x32, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34,
+						0x8F, 0x07, 0x05, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x35, 0x8F,
+						0x07, 0x06, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x36 };
+
+static unsigned char setup_menu_631[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x02, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x02, 0xB4,
+						0x00, 0x06, 0x02, 0xB4, 0x00,
+						0x06, 0x02, 0xB4 };
+
+static unsigned char setup_menu_632[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x32, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34,
+						0x8F, 0x07, 0x05, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x35, 0x8F,
+						0x07, 0x06, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x36 };
+
+static unsigned char setup_menu_641[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x04, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x04, 0xB4,
+						0x00, 0x06, 0x04, 0xB4, 0x00,
+						0x06, 0x04, 0xB4 };
+
+static unsigned char setup_menu_642[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x32, 0x8F, 0x07, 0x04, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x34,
+						0x8F, 0x07, 0x05, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x35, 0x8F,
+						0x07, 0x06, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x36, 0xD0, 0x04,
+						0x00, 0x0E, 0x00, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x00, 0xB4,
+						0x00, 0x06, 0x00, 0xB4, 0x00,
+						0x06, 0x00, 0xB4 };
+
+static unsigned char setup_menu_643[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x33, 0x8F, 0x07, 0x07, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x37,
+						0x8F, 0x07, 0x08, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x38, 0x8F,
+						0x07, 0x09, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x39 };
+
+static unsigned char setup_menu_651[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x08, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x08, 0xB4,
+						0x00, 0x06, 0x08, 0xB4, 0x00,
+						0x06, 0x08, 0xB4 };
+
+static unsigned char setup_menu_661[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x10, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x10, 0xB4,
+						0x00, 0x06, 0x10, 0xB4, 0x00,
+						0x06, 0x10, 0xB4 };
+
+static unsigned char setup_menu_671[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x20, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x20, 0xB4,
+						0x00, 0x06, 0x20, 0xB4, 0x00,
+						0x06, 0x20, 0xB4 };
+
+static unsigned char setup_menu_681[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x40, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x40, 0xB4,
+						0x00, 0x06, 0x40, 0xB4, 0x00,
+						0x06, 0x40, 0xB4 };
+
+static unsigned char setup_menu_691[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x20,
+						0x31, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0xD0, 0x04,
+						0x00, 0x0E, 0x80, 0xB4, 0xD1,
+						0x0C, 0x00, 0x06, 0x80, 0xB4,
+						0x00, 0x06, 0x80, 0xB4, 0x00,
+						0x06, 0x80, 0xB4 };
+
+static unsigned char setup_menu_6101[] = { 0xD0, 0x46, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0C, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x4D, 0x65, 0x6E, 0x75, 0x8F,
+						0x07, 0x01, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x31, 0x8F, 0x07,
+						0x02, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x32, 0x8F, 0x07, 0x03,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x33, 0xD0, 0x04, 0x00, 0x0C,
+						0x00, 0xB4, 0xD1, 0x0C, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4, 0x00, 0x06, 0x00,
+						0xB4 };
+
+static unsigned char setup_menu_711[] = { 0xD0, 0x81, 0x9C, 0x81, 0x03, 0x01,
+						0x25, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x19, 0x80, 0x04,
+						0x17, 0x04, 0x14, 0x04, 0x20,
+						0x04, 0x10, 0x04, 0x12, 0x04,
+						0x21, 0x04, 0x22, 0x04, 0x12,
+						0x04, 0x23, 0x04, 0x19, 0x04,
+						0x22, 0x04, 0x15, 0x8F, 0x1C,
+						0x01, 0x80, 0x04, 0x17, 0x04,
+						0x14, 0x04, 0x20, 0x04, 0x10,
+						0x04, 0x12, 0x04, 0x21, 0x04,
+						0x22, 0x04, 0x12, 0x04, 0x23,
+						0x04, 0x19, 0x04, 0x22, 0x04,
+						0x15, 0x00, 0x31, 0x8F, 0x1C,
+						0x02, 0x80, 0x04, 0x17, 0x04,
+						0x14, 0x04, 0x20, 0x04, 0x10,
+						0x04, 0x12, 0x04, 0x21, 0x04,
+						0x22, 0x04, 0x12, 0x04, 0x23,
+						0x04, 0x19, 0x04, 0x22, 0x04,
+						0x15, 0x00, 0x32, 0x8F, 0x1C,
+						0x03, 0x80, 0x04, 0x17, 0x04,
+						0x14, 0x04, 0x20, 0x04, 0x10,
+						0x04, 0x12, 0x04, 0x21, 0x04,
+						0x22, 0x04, 0x12, 0x04, 0x23,
+						0x04, 0x19, 0x04, 0x22, 0x04,
+						0x15, 0x00, 0x33, 0x8F, 0x1C,
+						0x04, 0x80, 0x04, 0x17, 0x04,
+						0x14, 0x04, 0x20, 0x04, 0x10,
+						0x04, 0x12, 0x04, 0x21, 0x04,
+						0x22, 0x04, 0x12, 0x04, 0x23,
+						0x04, 0x19, 0x04, 0x22, 0x04,
+						0x15, 0x00, 0x34 };
+
+static unsigned char setup_menu_712[] = { 0xD0, 0x60, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x19, 0x80, 0x04, 0x17,
+						0x04, 0x14, 0x04, 0x20, 0x04,
+						0x10, 0x04, 0x12, 0x04, 0x21,
+						0x04, 0x22, 0x04, 0x12, 0x04,
+						0x23, 0x04, 0x19, 0x04, 0x22,
+						0x04, 0x15, 0x8F, 0x1C, 0x11,
+						0x80, 0x04, 0x17, 0x04, 0x14,
+						0x04, 0x20, 0x04, 0x10, 0x04,
+						0x12, 0x04, 0x21, 0x04, 0x22,
+						0x04, 0x12, 0x04, 0x23, 0x04,
+						0x19, 0x04, 0x22, 0x04, 0x15,
+						0x00, 0x35, 0x8F, 0x1C, 0x12,
+						0x80, 0x04, 0x17, 0x04, 0x14,
+						0x04, 0x20, 0x04, 0x10, 0x04,
+						0x12, 0x04, 0x21, 0x04, 0x22,
+						0x04, 0x12, 0x04, 0x23, 0x04,
+						0x19, 0x04, 0x22, 0x04, 0x15,
+						0x00, 0x36 };
+
+static unsigned char setup_menu_713[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x00, 0x8F, 0x00 };
+
+static unsigned char setup_menu_811[] = { 0xD0, 0x3C, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x09, 0x80, 0x5D, 0xE5,
+						0x51, 0x77, 0x7B, 0xB1, 0x53,
+						0x55, 0x8F, 0x08, 0x01, 0x80,
+						0x98, 0x79, 0x76, 0xEE, 0x4E,
+						0x00, 0x8F, 0x08, 0x02, 0x80,
+						0x98, 0x79, 0x76, 0xEE, 0x4E,
+						0x8C, 0x8F, 0x08, 0x03, 0x80,
+						0x98, 0x79, 0x76, 0xEE, 0x4E,
+						0x09, 0x8F, 0x08, 0x04, 0x80,
+						0x98, 0x79, 0x76, 0xEE, 0x56,
+						0xDB };
+
+static unsigned char setup_menu_812[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x09, 0x80, 0x5D, 0xE5,
+						0x51, 0x77, 0x7B, 0xB1, 0x53,
+						0x55, 0x8F, 0x04, 0x11, 0x80,
+						0x4E, 0x00, 0x8F, 0x04, 0x12,
+						0x80, 0x4E, 0x8C };
+
+static unsigned char setup_menu_813[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x00, 0x8F, 0x00 };
+
+static unsigned char setup_menu_911[] = { 0xD0, 0x44, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x09, 0x80, 0x00, 0x38,
+						0x00, 0x30, 0x30, 0xEB, 0x00,
+						0x30, 0x8F, 0x0A, 0x01, 0x80,
+						0x00, 0x38, 0x00, 0x30, 0x30,
+						0xEB, 0x00, 0x31, 0x8F, 0x0A,
+						0x02, 0x80, 0x00, 0x38, 0x00,
+						0x30, 0x30, 0xEB, 0x00, 0x32,
+						0x8F, 0x0A, 0x03, 0x80, 0x00,
+						0x38, 0x00, 0x30, 0x30, 0xEB,
+						0x00, 0x33, 0x8F, 0x0A, 0x04,
+						0x80, 0x00, 0x38, 0x00, 0x30,
+						0x30, 0xEB, 0x00, 0x34 };
+
+static unsigned char setup_menu_912[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x09, 0x80, 0x00, 0x38,
+						0x00, 0x30, 0x30, 0xEB, 0x00,
+						0x30, 0x8F, 0x0A, 0x11, 0x80,
+						0x00, 0x38, 0x00, 0x30, 0x30,
+						0xEB, 0x00, 0x35, 0x8F, 0x0A,
+						0x12, 0x80, 0x00, 0x38, 0x00,
+						0x30, 0x30, 0xEB, 0x00, 0x36 };
+
+static unsigned char setup_menu_913[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x00, 0x8F, 0x00 };
+
+static struct setup_menu_test setup_menu_data_111 = {
+	.pdu = setup_menu_111,
+	.pdu_len = sizeof(setup_menu_111),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "Item 4"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_112 = {
+	.pdu = setup_menu_112,
+	.pdu_len = sizeof(setup_menu_112),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 0x11,
+		.text = "One"
+	},
+	.items[1] = {
+		.id = 0x12,
+		.text = "Two"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_113 = {
+	.pdu = setup_menu_113,
+	.pdu_len = sizeof(setup_menu_113),
+	.qualifier = 0x00
+};
+
+static struct setup_menu_test setup_menu_data_121 = {
+	.pdu = setup_menu_121,
+	.pdu_len = sizeof(setup_menu_121),
+	.qualifier = 0x00,
+	.alpha_id = "LargeMenu1",
+	.items[0] = {
+		.id = 0x50,
+		.text = "Zero"
+	},
+	.items[1] = {
+		.id = 0x4F,
+		.text = "One"
+	},
+	.items[2] = {
+		.id = 0x4E,
+		.text = "Two"
+	},
+	.items[3] = {
+		.id = 0x4D,
+		.text = "Three"
+	},
+	.items[4] = {
+		.id = 0x4C,
+		.text = "Four"
+	},
+	.items[5] = {
+		.id = 0x4B,
+		.text = "Five"
+	},
+	.items[6] = {
+		.id = 0x4A,
+		.text = "Six"
+	},
+	.items[7] = {
+		.id = 0x49,
+		.text = "Seven"
+	},
+	.items[8] = {
+		.id = 0x48,
+		.text = "Eight"
+	},
+	.items[9] = {
+		.id = 0x47,
+		.text = "Nine"
+	},
+	.items[10] = {
+		.id = 0x46,
+		.text = "Alpha"
+	},
+	.items[11] = {
+		.id = 0x45,
+		.text = "Bravo"
+	},
+	.items[12] = {
+		.id = 0x44,
+		.text = "Charlie"
+	},
+	.items[13] = {
+		.id = 0x43,
+		.text = "Delta"
+	},
+	.items[14] = {
+		.id = 0x42,
+		.text = "Echo"
+	},
+	.items[15] = {
+		.id = 0x41,
+		.text = "Fox-trot"
+	},
+	.items[16] = {
+		.id = 0x40,
+		.text = "Black"
+	},
+	.items[17] = {
+		.id = 0x3F,
+		.text = "Brown"
+	},
+	.items[18] = {
+		.id = 0x3E,
+		.text = "Red"
+	},
+	.items[19] = {
+		.id = 0x3D,
+		.text = "Orange"
+	},
+	.items[20] = {
+		.id = 0x3C,
+		.text = "Yellow"
+	},
+	.items[21] = {
+		.id = 0x3B,
+		.text = "Green"
+	},
+	.items[22] = {
+		.id = 0x3A,
+		.text = "Blue"
+	},
+	.items[23] = {
+		.id = 0x39,
+		.text = "Violet"
+	},
+	.items[24] = {
+		.id = 0x38,
+		.text = "Grey"
+	},
+	.items[25] = {
+		.id = 0x37,
+		.text = "White"
+	},
+	.items[26] = {
+		.id = 0x36,
+		.text = "milli"
+	},
+	.items[27] = {
+		.id = 0x35,
+		.text = "micro"
+	},
+	.items[28] = {
+		.id = 0x34,
+		.text = "nano"
+	},
+	.items[29] = {
+		.id = 0x33,
+		.text = "pico"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_122 = {
+	.pdu = setup_menu_122,
+	.pdu_len = sizeof(setup_menu_122),
+	.qualifier = 0x00,
+	.alpha_id = "LargeMenu2",
+	.items[0] = {
+		.id = 0xFF,
+		.text = "1 Call Forward Unconditional"
+	},
+	.items[1] = {
+		.id = 0xFE,
+		.text = "2 Call Forward On User Busy"
+	},
+	.items[2] = {
+		.id = 0xFD,
+		.text = "3 Call Forward On No Reply"
+	},
+	.items[3] = {
+		.id = 0xFC,
+		.text = "4 Call Forward On User Not Reachable"
+	},
+	.items[4] = {
+		.id = 0xFB,
+		.text = "5 Barring Of All Outgoing Calls"
+	},
+	.items[5] = {
+		.id = 0xFA,
+		.text = "6 Barring Of All Outgoing Int Calls"
+	},
+	.items[6] = {
+		.id = 0xF9,
+		.text = "7 CLI Presentation"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_123 = {
+	.pdu = setup_menu_123,
+	.pdu_len = sizeof(setup_menu_123),
+	.qualifier = 0x00,
+	.alpha_id = "The SIM shall supply a set of menu items, which shall "
+			"be integrated with the menu system (or other MMI "
+			"facility) in order to give the user the opportunity "
+			"to choose one of these menu items at his own "
+			"discretion. Each item comprises a sh",
+	.items[0] = {
+		.id = 0x01,
+		.text = "Y"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_211 = {
+	.pdu = setup_menu_211,
+	.pdu_len = sizeof(setup_menu_211),
+	.qualifier = 0x80,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "Item 4"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_311 = {
+	.pdu = setup_menu_311,
+	.pdu_len = sizeof(setup_menu_311),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "Item 4"
+	},
+	.next_act = {
+		.list = { STK_COMMAND_TYPE_SEND_SMS,
+				STK_COMMAND_TYPE_SETUP_CALL,
+				STK_COMMAND_TYPE_LAUNCH_BROWSER,
+				STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO },
+		.len = 4
+	}
+};
+
+static struct setup_menu_test setup_menu_data_411 = {
+	.pdu = setup_menu_411,
+	.pdu_len = sizeof(setup_menu_411),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 1
+	},
+	.item_icon_id_list = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.list = { 5, 5, 5 },
+		.len = 3
+	}
+};
+
+static struct setup_menu_test setup_menu_data_421 = {
+	.pdu = setup_menu_421,
+	.pdu_len = sizeof(setup_menu_421),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 1
+	},
+	.item_icon_id_list = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.list = { 5, 5, 5 },
+		.len = 3
+	}
+};
+
+static struct setup_menu_test setup_menu_data_511 = {
+	.pdu = setup_menu_511,
+	.pdu_len = sizeof(setup_menu_511),
+	.qualifier = 0x01,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_611 = {
+	.pdu = setup_menu_611,
+	.pdu_len = sizeof(setup_menu_611),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4,
+				0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_612 = {
+	.pdu = setup_menu_612,
+	.pdu_len = sizeof(setup_menu_612),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 2",
+	.items[0] = {
+		.id = 4,
+		.text = "Item 4"
+	},
+	.items[1] = {
+		.id = 5,
+		.text = "Item 5"
+	},
+	.items[2] = {
+		.id = 6,
+		.text = "Item 6"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_621 = {
+	.pdu = setup_menu_621,
+	.pdu_len = sizeof(setup_menu_621),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x01, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x01, 0xB4, 0x00, 0x06, 0x01, 0xB4,
+				0x00, 0x06, 0x01, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_622 = {
+	.pdu = setup_menu_622,
+	.pdu_len = sizeof(setup_menu_622),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 2",
+	.items[0] = {
+		.id = 4,
+		.text = "Item 4"
+	},
+	.items[1] = {
+		.id = 5,
+		.text = "Item 5"
+	},
+	.items[2] = {
+		.id = 6,
+		.text = "Item 6"
+	}
+};
+
+/*
+ * Some problem with data of item #3 in item_text_attr_list
+ * and the explanation
+ */
+static struct setup_menu_test setup_menu_data_631 = {
+	.pdu = setup_menu_631,
+	.pdu_len = sizeof(setup_menu_631),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x02, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x02, 0xB4, 0x00, 0x06, 0x02, 0xB4,
+				0x00, 0x06, 0x02, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_632 = {
+	.pdu = setup_menu_632,
+	.pdu_len = sizeof(setup_menu_632),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 2",
+	.items[0] = {
+		.id = 4,
+		.text = "Item 4"
+	},
+	.items[1] = {
+		.id = 5,
+		.text = "Item 5"
+	},
+	.items[2] = {
+		.id = 6,
+		.text = "Item 6"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_641 = {
+	.pdu = setup_menu_641,
+	.pdu_len = sizeof(setup_menu_641),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x04, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x04, 0xB4, 0x00, 0x06, 0x04, 0xB4,
+				0x00, 0x06, 0x04, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_642 = {
+	.pdu = setup_menu_642,
+	.pdu_len = sizeof(setup_menu_642),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 2",
+	.items[0] = {
+		.id = 4,
+		.text = "Item 4"
+	},
+	.items[1] = {
+		.id = 5,
+		.text = "Item 5"
+	},
+	.items[2] = {
+		.id = 6,
+		.text = "Item 6"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4,
+				0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_643 = {
+	.pdu = setup_menu_643,
+	.pdu_len = sizeof(setup_menu_643),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 3",
+	.items[0] = {
+		.id = 7,
+		.text = "Item 7"
+	},
+	.items[1] = {
+		.id = 8,
+		.text = "Item 8"
+	},
+	.items[2] = {
+		.id = 9,
+		.text = "Item 9"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_651 = {
+	.pdu = setup_menu_651,
+	.pdu_len = sizeof(setup_menu_651),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x08, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x08, 0xB4, 0x00, 0x06, 0x08, 0xB4,
+				0x00, 0x06, 0x08, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_661 = {
+	.pdu = setup_menu_661,
+	.pdu_len = sizeof(setup_menu_661),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x10, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x10, 0xB4, 0x00, 0x06, 0x10, 0xB4,
+				0x00, 0x06, 0x10, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_671 = {
+	.pdu = setup_menu_671,
+	.pdu_len = sizeof(setup_menu_671),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x20, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x20, 0xB4, 0x00, 0x06, 0x20, 0xB4,
+				0x00, 0x06, 0x20, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_681 = {
+	.pdu = setup_menu_681,
+	.pdu_len = sizeof(setup_menu_681),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x40, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x40, 0xB4, 0x00, 0x06, 0x40, 0xB4,
+				0x00, 0x06, 0x40, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_691 = {
+	.pdu = setup_menu_691,
+	.pdu_len = sizeof(setup_menu_691),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x80, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x80, 0xB4, 0x00, 0x06, 0x80, 0xB4,
+				0x00, 0x06, 0x80, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_6101 = {
+	.pdu = setup_menu_6101,
+	.pdu_len = sizeof(setup_menu_6101),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Menu",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x0C, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 12,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4,
+				0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_menu_test setup_menu_data_711 = {
+	.pdu = setup_menu_711,
+	.pdu_len = sizeof(setup_menu_711),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.items[0] = {
+		.id = 1,
+		.text = "ЗДРАВСТВУЙТЕ1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "ЗДРАВСТВУЙТЕ2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "ЗДРАВСТВУЙТЕ3"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "ЗДРАВСТВУЙТЕ4"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_712 = {
+	.pdu = setup_menu_712,
+	.pdu_len = sizeof(setup_menu_712),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.items[0] = {
+		.id = 0x11,
+		.text = "ЗДРАВСТВУЙТЕ5"
+	},
+	.items[1] = {
+		.id = 0x12,
+		.text = "ЗДРАВСТВУЙТЕ6"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_713 = {
+	.pdu = setup_menu_713,
+	.pdu_len = sizeof(setup_menu_713),
+	.qualifier = 0x00
+};
+
+static struct setup_menu_test setup_menu_data_811 = {
+	.pdu = setup_menu_811,
+	.pdu_len = sizeof(setup_menu_811),
+	.qualifier = 0x00,
+	.alpha_id = "工具箱单",
+	.items[0] = {
+		.id = 1,
+		.text = "项目一"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "项目二"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "项目三"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "项目四"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_812 = {
+	.pdu = setup_menu_812,
+	.pdu_len = sizeof(setup_menu_812),
+	.qualifier = 0x00,
+	.alpha_id = "工具箱单",
+	.items[0] = {
+		.id = 0x11,
+		.text = "一"
+	},
+	.items[1] = {
+		.id = 0x12,
+		.text = "二"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_813 = {
+	.pdu = setup_menu_813,
+	.pdu_len = sizeof(setup_menu_813),
+	.qualifier = 0x00
+};
+
+static struct setup_menu_test setup_menu_data_911 = {
+	.pdu = setup_menu_911,
+	.pdu_len = sizeof(setup_menu_911),
+	.qualifier = 0x00,
+	.alpha_id = "80ル0",
+	.items[0] = {
+		.id = 1,
+		.text = "80ル1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "80ル2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "80ル3"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "80ル4"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_912 = {
+	.pdu = setup_menu_912,
+	.pdu_len = sizeof(setup_menu_912),
+	.qualifier = 0x00,
+	.alpha_id = "80ル0",
+	.items[0] = {
+		.id = 0x11,
+		.text = "80ル5"
+	},
+	.items[1] = {
+		.id = 0x12,
+		.text = "80ル6"
+	}
+};
+
+static struct setup_menu_test setup_menu_data_913 = {
+	.pdu = setup_menu_913,
+	.pdu_len = sizeof(setup_menu_913),
+	.qualifier = 0x00
+};
+
+/* Defined in TS 102.384 Section 27.22.4.7 */
+static void test_setup_menu(gconstpointer data)
+{
+	const struct setup_menu_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_SETUP_MENU);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	if (test->alpha_id)
+		g_assert(command->setup_menu.alpha_id);
+	check_common_text(command->setup_menu.alpha_id, test->alpha_id);
+	check_items(command->setup_menu.items, test->items);
+	check_items_next_action_indicator(&command->setup_menu.next_act,
+						&test->next_act);
+	check_icon_id(&command->setup_menu.icon_id, &test->icon_id);
+	check_item_icon_id_list(&command->setup_menu.item_icon_id_list,
+					&test->item_icon_id_list);
+	check_text_attr(&command->setup_menu.text_attr, &test->text_attr);
+	check_item_text_attribute_list(&command->setup_menu.item_text_attr_list,
+					&test->item_text_attr_list);
+
+	stk_command_free(command);
+}
+
 struct send_sms_test {
 	const unsigned char *pdu;
 	unsigned int pdu_len;
@@ -4367,6 +5912,77 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Poll Interval 1.1.1",
 				&poll_interval_data_111, test_poll_interval);
 
+	g_test_add_data_func("/teststk/Setup Menu 1.1.1",
+				&setup_menu_data_111, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 1.1.2",
+				&setup_menu_data_112, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 1.1.3",
+				&setup_menu_data_113, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 1.2.1",
+				&setup_menu_data_121, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 1.2.2",
+				&setup_menu_data_122, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 1.2.3",
+				&setup_menu_data_123, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 2.1.1",
+				&setup_menu_data_211, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 3.1.1",
+				&setup_menu_data_311, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 4.1.1",
+				&setup_menu_data_411, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 4.2.1",
+				&setup_menu_data_421, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 5.1.1",
+				&setup_menu_data_511, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.1.1",
+				&setup_menu_data_611, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.1.2",
+				&setup_menu_data_612, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.2.1",
+				&setup_menu_data_621, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.2.2",
+				&setup_menu_data_622, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.3.1",
+				&setup_menu_data_631, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.3.2",
+				&setup_menu_data_632, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.4.1",
+				&setup_menu_data_641, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.4.2",
+				&setup_menu_data_642, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.4.3",
+				&setup_menu_data_643, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.5.1",
+				&setup_menu_data_651, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.6.1",
+				&setup_menu_data_661, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.7.1",
+				&setup_menu_data_671, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.8.1",
+				&setup_menu_data_681, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.9.1",
+				&setup_menu_data_691, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 6.10.1",
+				&setup_menu_data_6101, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 7.1.1",
+				&setup_menu_data_711, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 7.1.2",
+				&setup_menu_data_712, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 7.1.3",
+				&setup_menu_data_713, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 8.1.1",
+				&setup_menu_data_811, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 8.1.2",
+				&setup_menu_data_812, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 8.1.3",
+				&setup_menu_data_813, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 9.1.1",
+				&setup_menu_data_911, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 9.1.2",
+				&setup_menu_data_912, test_setup_menu);
+	g_test_add_data_func("/teststk/Setup Menu 9.1.3",
+				&setup_menu_data_913, test_setup_menu);
+
 	g_test_add_data_func("/teststk/Send SMS 1.1",
 				&send_sms_data_11, test_send_sms);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 05/27] stkutil: Add select item proactive command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (2 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 04/27] test-stkutil: Add test for setup menu parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 06/27] test-stkutil: Add test for select item parser Yang Gu
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3565 bytes --]

---
 src/stkutil.c |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/stkutil.h |   13 +++++++++++
 2 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 1698321..1b2297d 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2382,6 +2382,70 @@ error:
 	return FALSE;
 }
 
+static void destroy_select_item(struct stk_command *command)
+{
+	g_free(command->select_item.alpha_id);
+	g_slist_foreach(command->select_item.items,
+				(GFunc)destroy_stk_item, NULL);
+	g_slist_free(command->select_item.items);
+}
+
+static gboolean parse_select_item(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_select_item *obj = &command->select_item;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		goto error;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		goto error;
+
+	ret = parse_dataobj(iter,
+			STK_DATA_OBJECT_TYPE_ALPHA_ID,
+			DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+			&obj->alpha_id,
+			STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		goto error;
+
+	ret = parse_list(iter, STK_DATA_OBJECT_TYPE_ITEM,
+				DATAOBJ_FLAG_MANDATORY, &obj->items);
+
+	if (ret == FALSE)
+		goto error;
+
+	ret = parse_dataobj(iter,
+			STK_DATA_OBJECT_TYPE_ITEMS_NEXT_ACTION_INDICATOR, 0,
+			&obj->next_act,
+			STK_DATA_OBJECT_TYPE_ITEM_ID, 0,
+			&obj->item_id,
+			STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+			&obj->icon_id,
+			STK_DATA_OBJECT_TYPE_ITEM_ICON_ID_LIST, 0,
+			&obj->item_icon_id_list,
+			STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+			&obj->text_attr,
+			STK_DATA_OBJECT_TYPE_ITEM_TEXT_ATTRIBUTE_LIST, 0,
+			&obj->item_text_attr_list,
+			STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+			&obj->frame_id,
+			STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		goto error;
+
+	command->destructor = destroy_setup_menu;
+
+	return TRUE;
+
+error:
+	destroy_select_item(command);
+	return FALSE;
+}
+
 static void destroy_send_sms(struct stk_command *command)
 {
 	g_free(command->send_sms.alpha_id);
@@ -2516,6 +2580,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_SETUP_MENU:
 		ok = parse_setup_menu(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_SELECT_ITEM:
+		ok = parse_select_item(command, &iter);
+		break;
 	case STK_COMMAND_TYPE_SEND_SMS:
 		ok = parse_send_sms(command, &iter);
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index e22292b..d017dc9 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -838,6 +838,18 @@ struct stk_command_setup_menu {
 	struct stk_item_text_attribute_list item_text_attr_list;
 };
 
+struct stk_command_select_item {
+	char *alpha_id;
+	GSList *items;
+	struct stk_items_next_action_indicator next_act;
+	unsigned char item_id;
+	struct stk_icon_id icon_id;
+	struct stk_item_icon_id_list item_icon_id_list;
+	struct stk_text_attribute text_attr;
+	struct stk_item_text_attribute_list item_text_attr_list;
+	struct stk_frame_id frame_id;
+};
+
 struct stk_command_send_sms {
 	char *alpha_id;
 	struct stk_address address;
@@ -860,6 +872,7 @@ struct stk_command {
 		struct stk_command_get_inkey get_inkey;
 		struct stk_command_get_input get_input;
 		struct stk_command_play_tone play_tone;
+		struct stk_command_select_item select_item;
 		struct stk_command_send_sms send_sms;
 		struct stk_command_poll_interval poll_interval;
 		struct stk_command_setup_menu setup_menu;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 06/27] test-stkutil: Add test for select item parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (3 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 05/27] stkutil: Add select item proactive command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 07/27] test-stkutil: Use dedicated functions to check Yang Gu
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 59640 bytes --]

---
 unit/test-stkutil.c | 2035 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 2035 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index dc33183..2fa449d 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -87,6 +87,13 @@ static void check_item(const struct stk_item *command,
 	g_assert(g_str_equal(command->text, test->text));
 }
 
+/* Defined in TS 102.223 Section 8.10 */
+static inline void check_item_id(const unsigned char command,
+					const unsigned char test)
+{
+	check_common_byte(command, test);
+}
+
 static void check_items(GSList *command, const struct stk_item *test)
 {
 	struct stk_item *si;
@@ -5471,6 +5478,1937 @@ static void test_setup_menu(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct select_item_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	char *alpha_id;
+	struct stk_item items[MAX_ITEM];
+	struct stk_items_next_action_indicator next_act;
+	unsigned char item_id;
+	struct stk_icon_id icon_id;
+	struct stk_item_icon_id_list item_icon_id_list;
+	struct stk_text_attribute text_attr;
+	struct stk_item_text_attribute_list item_text_attr_list;
+	struct stk_frame_id frame_id;
+};
+
+static unsigned char select_item_111[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0x8F, 0x07,
+						0x04, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x34 };
+
+static unsigned char select_item_121[] = { 0xD0, 0x81, 0xFC, 0x81, 0x03, 0x01,
+						0x24, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x0A, 0x4C, 0x61,
+						0x72, 0x67, 0x65, 0x4D, 0x65,
+						0x6E, 0x75, 0x31, 0x8F, 0x05,
+						0x50, 0x5A, 0x65, 0x72, 0x6F,
+						0x8F, 0x04, 0x4F, 0x4F, 0x6E,
+						0x65, 0x8F, 0x04, 0x4E, 0x54,
+						0x77, 0x6F, 0x8F, 0x06, 0x4D,
+						0x54, 0x68, 0x72, 0x65, 0x65,
+						0x8F, 0x05, 0x4C, 0x46, 0x6F,
+						0x75, 0x72, 0x8F, 0x05, 0x4B,
+						0x46, 0x69, 0x76, 0x65, 0x8F,
+						0x04, 0x4A, 0x53, 0x69, 0x78,
+						0x8F, 0x06, 0x49, 0x53, 0x65,
+						0x76, 0x65, 0x6E, 0x8F, 0x06,
+						0x48, 0x45, 0x69, 0x67, 0x68,
+						0x74, 0x8F, 0x05, 0x47, 0x4E,
+						0x69, 0x6E, 0x65, 0x8F, 0x06,
+						0x46, 0x41, 0x6C, 0x70, 0x68,
+						0x61, 0x8F, 0x06, 0x45, 0x42,
+						0x72, 0x61, 0x76, 0x6F, 0x8F,
+						0x08, 0x44, 0x43, 0x68, 0x61,
+						0x72, 0x6C, 0x69, 0x65, 0x8F,
+						0x06, 0x43, 0x44, 0x65, 0x6C,
+						0x74, 0x61, 0x8F, 0x05, 0x42,
+						0x45, 0x63, 0x68, 0x6F, 0x8F,
+						0x09, 0x41, 0x46, 0x6F, 0x78,
+						0x2D, 0x74, 0x72, 0x6F, 0x74,
+						0x8F, 0x06, 0x40, 0x42, 0x6C,
+						0x61, 0x63, 0x6B, 0x8F, 0x06,
+						0x3F, 0x42, 0x72, 0x6F, 0x77,
+						0x6E, 0x8F, 0x04, 0x3E, 0x52,
+						0x65, 0x64, 0x8F, 0x07, 0x3D,
+						0x4F, 0x72, 0x61, 0x6E, 0x67,
+						0x65, 0x8F, 0x07, 0x3C, 0x59,
+						0x65, 0x6C, 0x6C, 0x6F, 0x77,
+						0x8F, 0x06, 0x3B, 0x47, 0x72,
+						0x65, 0x65, 0x6E, 0x8F, 0x05,
+						0x3A, 0x42, 0x6C, 0x75, 0x65,
+						0x8F, 0x07, 0x39, 0x56, 0x69,
+						0x6F, 0x6C, 0x65, 0x74, 0x8F,
+						0x05, 0x38, 0x47, 0x72, 0x65,
+						0x79, 0x8F, 0x06, 0x37, 0x57,
+						0x68, 0x69, 0x74, 0x65, 0x8F,
+						0x06, 0x36, 0x6D, 0x69, 0x6C,
+						0x6C, 0x69, 0x8F, 0x06, 0x35,
+						0x6D, 0x69, 0x63, 0x72, 0x6F,
+						0x8F, 0x05, 0x34, 0x6E, 0x61,
+						0x6E, 0x6F, 0x8F, 0x05, 0x33,
+						0x70, 0x69, 0x63, 0x6F };
+
+static unsigned char select_item_131[] = { 0xD0, 0x81, 0xFB, 0x81, 0x03, 0x01,
+						0x24, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x0A, 0x4C, 0x61,
+						0x72, 0x67, 0x65, 0x4D, 0x65,
+						0x6E, 0x75, 0x32, 0x8F, 0x1E,
+						0xFF, 0x43, 0x61, 0x6C, 0x6C,
+						0x20, 0x46, 0x6F, 0x72, 0x77,
+						0x61, 0x72, 0x64, 0x69, 0x6E,
+						0x67, 0x20, 0x55, 0x6E, 0x63,
+						0x6F, 0x6E, 0x64, 0x69, 0x74,
+						0x69, 0x6F, 0x6E, 0x61, 0x6C,
+						0x8F, 0x1D, 0xFE, 0x43, 0x61,
+						0x6C, 0x6C, 0x20, 0x46, 0x6F,
+						0x72, 0x77, 0x61, 0x72, 0x64,
+						0x69, 0x6E, 0x67, 0x20, 0x4F,
+						0x6E, 0x20, 0x55, 0x73, 0x65,
+						0x72, 0x20, 0x42, 0x75, 0x73,
+						0x79, 0x8F, 0x1C, 0xFD, 0x43,
+						0x61, 0x6C, 0x6C, 0x20, 0x46,
+						0x6F, 0x72, 0x77, 0x61, 0x72,
+						0x64, 0x69, 0x6E, 0x67, 0x20,
+						0x4F, 0x6E, 0x20, 0x4E, 0x6F,
+						0x20, 0x52, 0x65, 0x70, 0x6C,
+						0x79, 0x8F, 0x26, 0xFC, 0x43,
+						0x61, 0x6C, 0x6C, 0x20, 0x46,
+						0x6F, 0x72, 0x77, 0x61, 0x72,
+						0x64, 0x69, 0x6E, 0x67, 0x20,
+						0x4F, 0x6E, 0x20, 0x55, 0x73,
+						0x65, 0x72, 0x20, 0x4E, 0x6F,
+						0x74, 0x20, 0x52, 0x65, 0x61,
+						0x63, 0x68, 0x61, 0x62, 0x6C,
+						0x65, 0x8F, 0x1E, 0xFB, 0x42,
+						0x61, 0x72, 0x72, 0x69, 0x6E,
+						0x67, 0x20, 0x4F, 0x66, 0x20,
+						0x41, 0x6C, 0x6C, 0x20, 0x4F,
+						0x75, 0x74, 0x67, 0x6F, 0x69,
+						0x6E, 0x67, 0x20, 0x43, 0x61,
+						0x6C, 0x6C, 0x73, 0x8F, 0x2C,
+						0xFA, 0x42, 0x61, 0x72, 0x72,
+						0x69, 0x6E, 0x67, 0x20, 0x4F,
+						0x66, 0x20, 0x41, 0x6C, 0x6C,
+						0x20, 0x4F, 0x75, 0x74, 0x67,
+						0x6F, 0x69, 0x6E, 0x67, 0x20,
+						0x49, 0x6E, 0x74, 0x65, 0x72,
+						0x6E, 0x61, 0x74, 0x69, 0x6F,
+						0x6E, 0x61, 0x6C, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x73, 0x8F,
+						0x11, 0xF9, 0x43, 0x4C, 0x49,
+						0x20, 0x50, 0x72, 0x65, 0x73,
+						0x65, 0x6E, 0x74, 0x61, 0x74,
+						0x69, 0x6F, 0x6E };
+
+static unsigned char select_item_141[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0B, 0x53, 0x65, 0x6C,
+						0x65, 0x63, 0x74, 0x20, 0x49,
+						0x74, 0x65, 0x6D, 0x8F, 0x04,
+						0x11, 0x4F, 0x6E, 0x65, 0x8F,
+						0x04, 0x12, 0x54, 0x77, 0x6F };
+
+static unsigned char select_item_151[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
+						0x24, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x81, 0xED, 0x54,
+						0x68, 0x65, 0x20, 0x53, 0x49,
+						0x4D, 0x20, 0x73, 0x68, 0x61,
+						0x6C, 0x6C, 0x20, 0x73, 0x75,
+						0x70, 0x70, 0x6C, 0x79, 0x20,
+						0x61, 0x20, 0x73, 0x65, 0x74,
+						0x20, 0x6F, 0x66, 0x20, 0x69,
+						0x74, 0x65, 0x6D, 0x73, 0x20,
+						0x66, 0x72, 0x6F, 0x6D, 0x20,
+						0x77, 0x68, 0x69, 0x63, 0x68,
+						0x20, 0x74, 0x68, 0x65, 0x20,
+						0x75, 0x73, 0x65, 0x72, 0x20,
+						0x6D, 0x61, 0x79, 0x20, 0x63,
+						0x68, 0x6F, 0x6F, 0x73, 0x65,
+						0x20, 0x6F, 0x6E, 0x65, 0x2E,
+						0x20, 0x45, 0x61, 0x63, 0x68,
+						0x20, 0x69, 0x74, 0x65, 0x6D,
+						0x20, 0x63, 0x6F, 0x6D, 0x70,
+						0x72, 0x69, 0x73, 0x65, 0x73,
+						0x20, 0x61, 0x20, 0x73, 0x68,
+						0x6F, 0x72, 0x74, 0x20, 0x69,
+						0x64, 0x65, 0x6E, 0x74, 0x69,
+						0x66, 0x69, 0x65, 0x72, 0x20,
+						0x28, 0x75, 0x73, 0x65, 0x64,
+						0x20, 0x74, 0x6F, 0x20, 0x69,
+						0x6E, 0x64, 0x69, 0x63, 0x61,
+						0x74, 0x65, 0x20, 0x74, 0x68,
+						0x65, 0x20, 0x73, 0x65, 0x6C,
+						0x65, 0x63, 0x74, 0x69, 0x6F,
+						0x6E, 0x29, 0x20, 0x61, 0x6E,
+						0x64, 0x20, 0x61, 0x20, 0x74,
+						0x65, 0x78, 0x74, 0x20, 0x73,
+						0x74, 0x72, 0x69, 0x6E, 0x67,
+						0x2E, 0x20, 0x4F, 0x70, 0x74,
+						0x69, 0x6F, 0x6E, 0x61, 0x6C,
+						0x6C, 0x79, 0x20, 0x74, 0x68,
+						0x65, 0x20, 0x53, 0x49, 0x4D,
+						0x20, 0x6D, 0x61, 0x79, 0x20,
+						0x69, 0x6E, 0x63, 0x6C, 0x75,
+						0x64, 0x65, 0x20, 0x61, 0x6E,
+						0x20, 0x61, 0x6C, 0x70, 0x68,
+						0x61, 0x20, 0x69, 0x64, 0x65,
+						0x6E, 0x74, 0x69, 0x66, 0x69,
+						0x65, 0x72, 0x2E, 0x20, 0x54,
+						0x68, 0x65, 0x20, 0x61, 0x6C,
+						0x70, 0x68, 0x61, 0x20, 0x69,
+						0x64, 0x65, 0x6E, 0x74, 0x69,
+						0x66, 0x69, 0x65, 0x72, 0x20,
+						0x69, 0x8F, 0x02, 0x01, 0x59 };
+
+static unsigned char select_item_161[] = { 0xD0, 0x81, 0xF3, 0x81, 0x03, 0x01,
+						0x24, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x85, 0x0A, 0x30, 0x4C,
+						0x61, 0x72, 0x67, 0x65, 0x4D,
+						0x65, 0x6E, 0x75, 0x8F, 0x1D,
+						0xFF, 0x31, 0x20, 0x43, 0x61,
+						0x6C, 0x6C, 0x20, 0x46, 0x6F,
+						0x72, 0x77, 0x61, 0x72, 0x64,
+						0x20, 0x55, 0x6E, 0x63, 0x6F,
+						0x6E, 0x64, 0x69, 0x74, 0x69,
+						0x6F, 0x6E, 0x61, 0x6C, 0x8F,
+						0x1C, 0xFE, 0x32, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x20, 0x46,
+						0x6F, 0x72, 0x77, 0x61, 0x72,
+						0x64, 0x20, 0x4F, 0x6E, 0x20,
+						0x55, 0x73, 0x65, 0x72, 0x20,
+						0x42, 0x75, 0x73, 0x79, 0x8F,
+						0x1B, 0xFD, 0x33, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x20, 0x46,
+						0x6F, 0x72, 0x77, 0x61, 0x72,
+						0x64, 0x20, 0x4F, 0x6E, 0x20,
+						0x4E, 0x6F, 0x20, 0x52, 0x65,
+						0x70, 0x6C, 0x79, 0x8F, 0x25,
+						0xFC, 0x34, 0x20, 0x43, 0x61,
+						0x6C, 0x6C, 0x20, 0x46, 0x6F,
+						0x72, 0x77, 0x61, 0x72, 0x64,
+						0x20, 0x4F, 0x6E, 0x20, 0x55,
+						0x73, 0x65, 0x72, 0x20, 0x4E,
+						0x6F, 0x74, 0x20, 0x52, 0x65,
+						0x61, 0x63, 0x68, 0x61, 0x62,
+						0x6C, 0x65, 0x8F, 0x20, 0xFB,
+						0x35, 0x20, 0x42, 0x61, 0x72,
+						0x72, 0x69, 0x6E, 0x67, 0x20,
+						0x4F, 0x66, 0x20, 0x41, 0x6C,
+						0x6C, 0x20, 0x4F, 0x75, 0x74,
+						0x67, 0x6F, 0x69, 0x6E, 0x67,
+						0x20, 0x43, 0x61, 0x6C, 0x6C,
+						0x73, 0x8F, 0x24, 0xFA, 0x36,
+						0x20, 0x42, 0x61, 0x72, 0x72,
+						0x69, 0x6E, 0x67, 0x20, 0x4F,
+						0x66, 0x20, 0x41, 0x6C, 0x6C,
+						0x20, 0x4F, 0x75, 0x74, 0x67,
+						0x6F, 0x69, 0x6E, 0x67, 0x20,
+						0x49, 0x6E, 0x74, 0x20, 0x43,
+						0x61, 0x6C, 0x6C, 0x73, 0x8F,
+						0x13, 0xF9, 0x37, 0x20, 0x43,
+						0x4C, 0x49, 0x20, 0x50, 0x72,
+						0x65, 0x73, 0x65, 0x6E, 0x74,
+						0x61, 0x74, 0x69, 0x6F, 0x6E };
+
+static unsigned char select_item_211[] = { 0xD0, 0x39, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0x18, 0x03,
+						0x13, 0x10, 0x26 };
+
+static unsigned char select_item_311[] = { 0xD0, 0x37, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0x90, 0x01,
+						0x02 };
+
+static unsigned char select_item_411[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
+						0x80, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33 };
+
+static unsigned char select_item_511[] = { 0xD0, 0x3E, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0x9E, 0x02,
+						0x01, 0x01, 0x9F, 0x04, 0x01,
+						0x05, 0x05, 0x05 };
+
+static unsigned char select_item_521[] = { 0xD0, 0x3E, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33, 0x9E, 0x02,
+						0x00, 0x01, 0x9F, 0x04, 0x00,
+						0x05, 0x05, 0x05 };
+
+static unsigned char select_item_611[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
+						0x03, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33 };
+
+static unsigned char select_item_621[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32, 0x8F,
+						0x07, 0x03, 0x49, 0x74, 0x65,
+						0x6D, 0x20, 0x33 };
+
+static unsigned char select_item_711[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x24,
+						0x04, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0E, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x8F, 0x07, 0x01, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x31,
+						0x8F, 0x07, 0x02, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x32 };
+
+static unsigned char select_item_811[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0A, 0x3C, 0x54, 0x49,
+						0x4D, 0x45, 0x2D, 0x4F, 0x55,
+						0x54, 0x3E, 0x8F, 0x07, 0x01,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x31, 0x8F, 0x07, 0x02, 0x49,
+						0x74, 0x65, 0x6D, 0x20, 0x32,
+						0x8F, 0x07, 0x03, 0x49, 0x74,
+						0x65, 0x6D, 0x20, 0x33 };
+
+static unsigned char select_item_911[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_912[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34 };
+
+static unsigned char select_item_921[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x01, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x01, 0xB4, 0x00, 0x06,
+						0x01, 0xB4 };
+
+static unsigned char select_item_922[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34 };
+
+static unsigned char select_item_931[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x02, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x02, 0xB4, 0x00, 0x06,
+						0x02, 0xB4 };
+
+static unsigned char select_item_932[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34 };
+
+static unsigned char select_item_941[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x04, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x04, 0xB4, 0x00, 0x06,
+						0x04, 0xB4 };
+
+static unsigned char select_item_942[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_943[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x33, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x35, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x36 };
+
+static unsigned char select_item_951[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x08, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x08, 0xB4, 0x00, 0x06,
+						0x08, 0xB4 };
+
+static unsigned char select_item_952[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_953[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x33, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x35, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x36 };
+
+static unsigned char select_item_961[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x10, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x10, 0xB4, 0x00, 0x06,
+						0x10, 0xB4 };
+
+static unsigned char select_item_962[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_963[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x33, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x35, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x36 };
+
+static unsigned char select_item_971[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x20, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x20, 0xB4, 0x00, 0x06,
+						0x20, 0xB4 };
+
+static unsigned char select_item_972[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_973[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x33, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x35, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x36 };
+
+static unsigned char select_item_981[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x40, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x40, 0xB4, 0x00, 0x06,
+						0x40, 0xB4 };
+
+static unsigned char select_item_982[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_983[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x33, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x35, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x36 };
+
+static unsigned char select_item_991[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x80, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x80, 0xB4, 0x00, 0x06,
+						0x80, 0xB4 };
+
+static unsigned char select_item_992[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_993[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x33, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x35, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x36 };
+
+static unsigned char select_item_9101[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x31, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x31, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x32, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4, 0xD1, 0x08, 0x00,
+						0x06, 0x00, 0xB4, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char select_item_9102[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x54, 0x6F, 0x6F,
+						0x6C, 0x6B, 0x69, 0x74, 0x20,
+						0x53, 0x65, 0x6C, 0x65, 0x63,
+						0x74, 0x20, 0x32, 0x8F, 0x07,
+						0x01, 0x49, 0x74, 0x65, 0x6D,
+						0x20, 0x33, 0x8F, 0x07, 0x02,
+						0x49, 0x74, 0x65, 0x6D, 0x20,
+						0x34 };
+
+static unsigned char select_item_1011[] = { 0xD0, 0x7E, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x19, 0x80, 0x04, 0x17,
+						0x04, 0x14, 0x04, 0x20, 0x04,
+						0x10, 0x04, 0x12, 0x04, 0x21,
+						0x04, 0x22, 0x04, 0x12, 0x04,
+						0x23, 0x04, 0x19, 0x04, 0x22,
+						0x04, 0x15, 0x8F, 0x1C, 0x01,
+						0x80, 0x04, 0x17, 0x04, 0x14,
+						0x04, 0x20, 0x04, 0x10, 0x04,
+						0x12, 0x04, 0x21, 0x04, 0x22,
+						0x04, 0x12, 0x04, 0x23, 0x04,
+						0x19, 0x04, 0x22, 0x04, 0x15,
+						0x00, 0x31, 0x8F, 0x1C, 0x02,
+						0x80, 0x04, 0x17, 0x04, 0x14,
+						0x04, 0x20, 0x04, 0x10, 0x04,
+						0x12, 0x04, 0x21, 0x04, 0x22,
+						0x04, 0x12, 0x04, 0x23, 0x04,
+						0x19, 0x04, 0x22, 0x04, 0x15,
+						0x00, 0x32, 0x8F, 0x1C, 0x03,
+						0x80, 0x04, 0x17, 0x04, 0x14,
+						0x04, 0x20, 0x04, 0x10, 0x04,
+						0x12, 0x04, 0x21, 0x04, 0x22,
+						0x04, 0x12, 0x04, 0x23, 0x04,
+						0x19, 0x04, 0x22, 0x04, 0x15,
+						0x00, 0x33 };
+
+static unsigned char select_item_1021[] = { 0xD0, 0x53, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0F, 0x81, 0x0C, 0x08,
+						0x97, 0x94, 0xA0, 0x90, 0x92,
+						0xA1, 0xA2, 0x92, 0xA3, 0x99,
+						0xA2, 0x95, 0x8F, 0x11, 0x01,
+						0x81, 0x0D, 0x08, 0x97, 0x94,
+						0xA0, 0x90, 0x92, 0xA1, 0xA2,
+						0x92, 0xA3, 0x99, 0xA2, 0x95,
+						0x31, 0x8F, 0x11, 0x02, 0x81,
+						0x0D, 0x08, 0x97, 0x94, 0xA0,
+						0x90, 0x92, 0xA1, 0xA2, 0x92,
+						0xA3, 0x99, 0xA2, 0x95, 0x32,
+						0x8F, 0x11, 0x03, 0x81, 0x0D,
+						0x08, 0x97, 0x94, 0xA0, 0x90,
+						0x92, 0xA1, 0xA2, 0x92, 0xA3,
+						0x99, 0xA2, 0x95, 0x33 };
+
+static unsigned char select_item_1031[] = { 0xD0, 0x57, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x10, 0x82, 0x0C, 0x04,
+						0x10, 0x87, 0x84, 0x90, 0x80,
+						0x82, 0x91, 0x92, 0x82, 0x93,
+						0x89, 0x92, 0x85, 0x8F, 0x12,
+						0x01, 0x82, 0x0D, 0x04, 0x10,
+						0x87, 0x84, 0x90, 0x80, 0x82,
+						0x91, 0x92, 0x82, 0x93, 0x89,
+						0x92, 0x85, 0x31, 0x8F, 0x12,
+						0x02, 0x82, 0x0D, 0x04, 0x10,
+						0x87, 0x84, 0x90, 0x80, 0x82,
+						0x91, 0x92, 0x82, 0x93, 0x89,
+						0x92, 0x85, 0x32, 0x8F, 0x12,
+						0x03, 0x82, 0x0D, 0x04, 0x10,
+						0x87, 0x84, 0x90, 0x80, 0x82,
+						0x91, 0x92, 0x82, 0x93, 0x89,
+						0x92, 0x85, 0x33 };
+
+static unsigned char select_item_1111[] = { 0xD0, 0x3E, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x0B, 0x80, 0x5D, 0xE5,
+						0x51, 0x77, 0x7B, 0xB1, 0x90,
+						0x09, 0x62, 0xE9, 0x8F, 0x08,
+						0x01, 0x80, 0x98, 0x79, 0x76,
+						0xEE, 0x4E, 0x00, 0x8F, 0x08,
+						0x02, 0x80, 0x98, 0x79, 0x76,
+						0xEE, 0x4E, 0x8C, 0x8F, 0x08,
+						0x03, 0x80, 0x98, 0x79, 0x76,
+						0xEE, 0x4E, 0x09, 0x8F, 0x08,
+						0x04, 0x80, 0x98, 0x79, 0x76,
+						0xEE, 0x56, 0xDB };
+
+static unsigned char select_item_1211[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x09, 0x80, 0x00, 0x38,
+						0x00, 0x30, 0x30, 0xEB, 0x00,
+						0x30, 0x8F, 0x0A, 0x01, 0x80,
+						0x00, 0x38, 0x00, 0x30, 0x30,
+						0xEB, 0x00, 0x31, 0x8F, 0x0A,
+						0x02, 0x80, 0x00, 0x38, 0x00,
+						0x30, 0x30, 0xEB, 0x00, 0x32,
+						0x8F, 0x0A, 0x03, 0x80, 0x00,
+						0x38, 0x00, 0x30, 0x30, 0xEB,
+						0x00, 0x33 };
+
+static unsigned char select_item_1221[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x07, 0x81, 0x04, 0x61,
+						0x38, 0x31, 0xEB, 0x30, 0x8F,
+						0x08, 0x01, 0x81, 0x04, 0x61,
+						0x38, 0x31, 0xEB, 0x31, 0x8F,
+						0x08, 0x02, 0x81, 0x04, 0x61,
+						0x38, 0x31, 0xEB, 0x32, 0x8F,
+						0x08, 0x03, 0x81, 0x04, 0x61,
+						0x38, 0x31, 0xEB, 0x33 };
+
+static unsigned char select_item_1231[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0x85, 0x08, 0x82, 0x04, 0x30,
+						0xA0, 0x38, 0x32, 0xCB, 0x30,
+						0x8F, 0x09, 0x01, 0x82, 0x04,
+						0x30, 0xA0, 0x38, 0x32, 0xCB,
+						0x31, 0x8F, 0x09, 0x02, 0x82,
+						0x04, 0x30, 0xA0, 0x38, 0x32,
+						0xCB, 0x32, 0x8F, 0x09, 0x03,
+						0x82, 0x04, 0x30, 0xA0, 0x38,
+						0x32, 0xCB, 0x33 };
+
+static struct select_item_test select_item_data_111 = {
+	.pdu = select_item_111,
+	.pdu_len = sizeof(select_item_111),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "Item 4"
+	}
+};
+
+static struct select_item_test select_item_data_121 = {
+	.pdu = select_item_121,
+	.pdu_len = sizeof(select_item_121),
+	.qualifier = 0x00,
+	.alpha_id = "LargeMenu1",
+	.items[0] = {
+		.id = 0x50,
+		.text = "Zero"
+	},
+	.items[1] = {
+		.id = 0x4F,
+		.text = "One"
+	},
+	.items[2] = {
+		.id = 0x4E,
+		.text = "Two"
+	},
+	.items[3] = {
+		.id = 0x4D,
+		.text = "Three"
+	},
+	.items[4] = {
+		.id = 0x4C,
+		.text = "Four"
+	},
+	.items[5] = {
+		.id = 0x4B,
+		.text = "Five"
+	},
+	.items[6] = {
+		.id = 0x4A,
+		.text = "Six"
+	},
+	.items[7] = {
+		.id = 0x49,
+		.text = "Seven"
+	},
+	.items[8] = {
+		.id = 0x48,
+		.text = "Eight"
+	},
+	.items[9] = {
+		.id = 0x47,
+		.text = "Nine"
+	},
+	.items[10] = {
+		.id = 0x46,
+		.text = "Alpha"
+	},
+	.items[11] = {
+		.id = 0x45,
+		.text = "Bravo"
+	},
+	.items[12] = {
+		.id = 0x44,
+		.text = "Charlie"
+	},
+	.items[13] = {
+		.id = 0x43,
+		.text = "Delta"
+	},
+	.items[14] = {
+		.id = 0x42,
+		.text = "Echo"
+	},
+	.items[15] = {
+		.id = 0x41,
+		.text = "Fox-trot"
+	},
+	.items[16] = {
+		.id = 0x40,
+		.text = "Black"
+	},
+	.items[17] = {
+		.id = 0x3F,
+		.text = "Brown"
+	},
+	.items[18] = {
+		.id = 0x3E,
+		.text = "Red"
+	},
+	.items[19] = {
+		.id = 0x3D,
+		.text = "Orange"
+	},
+	.items[20] = {
+		.id = 0x3C,
+		.text = "Yellow"
+	},
+	.items[21] = {
+		.id = 0x3B,
+		.text = "Green"
+	},
+	.items[22] = {
+		.id = 0x3A,
+		.text = "Blue"
+	},
+	.items[23] = {
+		.id = 0x39,
+		.text = "Violet"
+	},
+	.items[24] = {
+		.id = 0x38,
+		.text = "Grey"
+	},
+	.items[25] = {
+		.id = 0x37,
+		.text = "White"
+	},
+	.items[26] = {
+		.id = 0x36,
+		.text = "milli"
+	},
+	.items[27] = {
+		.id = 0x35,
+		.text = "micro"
+	},
+	.items[28] = {
+		.id = 0x34,
+		.text = "nano"
+	},
+	.items[29] = {
+		.id = 0x33,
+		.text = "pico"
+	}
+};
+
+static struct select_item_test select_item_data_131 = {
+	.pdu = select_item_131,
+	.pdu_len = sizeof(select_item_131),
+	.qualifier = 0x00,
+	.alpha_id = "LargeMenu2",
+	.items[0] = {
+		.id = 0xFF,
+		.text = "Call Forwarding Unconditional"
+	},
+	.items[1] = {
+		.id = 0xFE,
+		.text = "Call Forwarding On User Busy"
+	},
+	.items[2] = {
+		.id = 0xFD,
+		.text = "Call Forwarding On No Reply"
+	},
+	.items[3] = {
+		.id = 0xFC,
+		.text = "Call Forwarding On User Not Reachable"
+	},
+	.items[4] = {
+		.id = 0xFB,
+		.text = "Barring Of All Outgoing Calls"
+	},
+	.items[5] = {
+		.id = 0xFA,
+		.text = "Barring Of All Outgoing International Calls"
+	},
+	.items[6] = {
+		.id = 0xF9,
+		.text = "CLI Presentation"
+	}
+};
+
+static struct select_item_test select_item_data_141 = {
+	.pdu = select_item_141,
+	.pdu_len = sizeof(select_item_141),
+	.qualifier = 0x00,
+	.alpha_id = "Select Item",
+	.items[0] = {
+		.id = 0x11,
+		.text = "One"
+	},
+	.items[1] = {
+		.id = 0x12,
+		.text = "Two"
+	}
+};
+
+static struct select_item_test select_item_data_151 = {
+	.pdu = select_item_151,
+	.pdu_len = sizeof(select_item_151),
+	.qualifier = 0x00,
+	.alpha_id = "The SIM shall supply a set of items from which the user "
+		"may choose one. Each item comprises a short identifier (used "
+		"to indicate the selection) and a text string. Optionally the "
+		"SIM may include an alpha identifier. The alpha identifier i",
+	.items[0] = {
+		.id = 0x01,
+		.text = "Y"
+	}
+};
+
+static struct select_item_test select_item_data_161 = {
+	.pdu = select_item_161,
+	.pdu_len = sizeof(select_item_161),
+	.qualifier = 0x00,
+	.alpha_id = "0LargeMenu",
+	.items[0] = {
+		.id = 0xFF,
+		.text = "1 Call Forward Unconditional"
+	},
+	.items[1] = {
+		.id = 0xFE,
+		.text = "2 Call Forward On User Busy"
+	},
+	.items[2] = {
+		.id = 0xFD,
+		.text = "3 Call Forward On No Reply"
+	},
+	.items[3] = {
+		.id = 0xFC,
+		.text = "4 Call Forward On User Not Reachable"
+	},
+	.items[4] = {
+		.id = 0xFB,
+		.text = "5 Barring Of All Outgoing Calls"
+	},
+	.items[5] = {
+		.id = 0xFA,
+		.text = "6 Barring Of All Outgoing Int Calls"
+	},
+	.items[6] = {
+		.id = 0xF9,
+		.text = "7 CLI Presentation"
+	}
+};
+
+static struct select_item_test select_item_data_211 = {
+	.pdu = select_item_211,
+	.pdu_len = sizeof(select_item_211),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.next_act = {
+		.list = { STK_COMMAND_TYPE_SEND_SMS,
+				STK_COMMAND_TYPE_SETUP_CALL,
+				STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO},
+		.len = 3
+	}
+};
+
+static struct select_item_test select_item_data_311 = {
+	.pdu = select_item_311,
+	.pdu_len = sizeof(select_item_311),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.item_id = 0x02
+};
+
+static struct select_item_test select_item_data_411 = {
+	.pdu = select_item_411,
+	.pdu_len = sizeof(select_item_411),
+	.qualifier = 0x80,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	}
+};
+
+static struct select_item_test select_item_data_511 = {
+	.pdu = select_item_511,
+	.pdu_len = sizeof(select_item_511),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 1
+	},
+	.item_icon_id_list = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.list = { 5, 5, 5 },
+		.len = 3
+	}
+};
+
+static struct select_item_test select_item_data_521 = {
+	.pdu = select_item_521,
+	.pdu_len = sizeof(select_item_521),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 1
+	},
+	.item_icon_id_list = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.list = { 5, 5, 5 },
+		.len = 3
+	}
+};
+
+static struct select_item_test select_item_data_611 = {
+	.pdu = select_item_611,
+	.pdu_len = sizeof(select_item_611),
+	.qualifier = 0x03,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	}
+};
+
+static struct select_item_test select_item_data_621 = {
+	.pdu = select_item_621,
+	.pdu_len = sizeof(select_item_621),
+	.qualifier = 0x01,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	}
+};
+
+static struct select_item_test select_item_data_711 = {
+	.pdu = select_item_711,
+	.pdu_len = sizeof(select_item_711),
+	.qualifier = 0x04,
+	.alpha_id = "Toolkit Select",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	}
+};
+
+static struct select_item_test select_item_data_811 = {
+	.pdu = select_item_811,
+	.pdu_len = sizeof(select_item_811),
+	.qualifier = 0x00,
+	.alpha_id = "<TIME-OUT>",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "Item 3"
+	}
+};
+
+static struct select_item_test select_item_data_911 = {
+	.pdu = select_item_911,
+	.pdu_len = sizeof(select_item_911),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_912 = {
+	.pdu = select_item_912,
+	.pdu_len = sizeof(select_item_912),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	}
+};
+
+static struct select_item_test select_item_data_921 = {
+	.pdu = select_item_921,
+	.pdu_len = sizeof(select_item_921),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x01, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x01, 0xB4, 0x00, 0x06, 0x01, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_922 = {
+	.pdu = select_item_922,
+	.pdu_len = sizeof(select_item_922),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	}
+};
+
+static struct select_item_test select_item_data_931 = {
+	.pdu = select_item_931,
+	.pdu_len = sizeof(select_item_931),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x02, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x02, 0xB4, 0x00, 0x06, 0x02, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_932 = {
+	.pdu = select_item_932,
+	.pdu_len = sizeof(select_item_932),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	}
+};
+
+static struct select_item_test select_item_data_941 = {
+	.pdu = select_item_941,
+	.pdu_len = sizeof(select_item_941),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x04, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x04, 0xB4, 0x00, 0x06, 0x04, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_942 = {
+	.pdu = select_item_942,
+	.pdu_len = sizeof(select_item_942),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_943 = {
+	.pdu = select_item_943,
+	.pdu_len = sizeof(select_item_943),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 3",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 5"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 6"
+	}
+};
+
+static struct select_item_test select_item_data_951 = {
+	.pdu = select_item_951,
+	.pdu_len = sizeof(select_item_951),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x08, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x08, 0xB4, 0x00, 0x06, 0x08, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_952 = {
+	.pdu = select_item_952,
+	.pdu_len = sizeof(select_item_952),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_953 = {
+	.pdu = select_item_953,
+	.pdu_len = sizeof(select_item_953),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 3",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 5"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 6"
+	}
+};
+
+static struct select_item_test select_item_data_961 = {
+	.pdu = select_item_961,
+	.pdu_len = sizeof(select_item_961),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x10, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x10, 0xB4, 0x00, 0x06, 0x10, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_962 = {
+	.pdu = select_item_962,
+	.pdu_len = sizeof(select_item_962),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_963 = {
+	.pdu = select_item_963,
+	.pdu_len = sizeof(select_item_963),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 3",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 5"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 6"
+	}
+};
+
+static struct select_item_test select_item_data_971 = {
+	.pdu = select_item_971,
+	.pdu_len = sizeof(select_item_971),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x20, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x20, 0xB4, 0x00, 0x06, 0x20, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_972 = {
+	.pdu = select_item_972,
+	.pdu_len = sizeof(select_item_972),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_973 = {
+	.pdu = select_item_973,
+	.pdu_len = sizeof(select_item_973),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 3",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 5"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 6"
+	}
+};
+
+static struct select_item_test select_item_data_981 = {
+	.pdu = select_item_981,
+	.pdu_len = sizeof(select_item_981),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x40, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x40, 0xB4, 0x00, 0x06, 0x40, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_982 = {
+	.pdu = select_item_982,
+	.pdu_len = sizeof(select_item_982),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_983 = {
+	.pdu = select_item_983,
+	.pdu_len = sizeof(select_item_983),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 3",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 5"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 6"
+	}
+};
+
+static struct select_item_test select_item_data_991 = {
+	.pdu = select_item_991,
+	.pdu_len = sizeof(select_item_991),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x80, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x80, 0xB4, 0x00, 0x06, 0x80, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_992 = {
+	.pdu = select_item_992,
+	.pdu_len = sizeof(select_item_992),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_993 = {
+	.pdu = select_item_993,
+	.pdu_len = sizeof(select_item_993),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 3",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 5"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 6"
+	}
+};
+
+static struct select_item_test select_item_data_9101 = {
+	.pdu = select_item_9101,
+	.pdu_len = sizeof(select_item_9101),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 1",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 2"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	},
+	.item_text_attr_list = {
+		.len = 8,
+		.list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct select_item_test select_item_data_9102 = {
+	.pdu = select_item_9102,
+	.pdu_len = sizeof(select_item_9102),
+	.qualifier = 0x00,
+	.alpha_id = "Toolkit Select 2",
+	.items[0] = {
+		.id = 1,
+		.text = "Item 3"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "Item 4"
+	}
+};
+
+static struct select_item_test select_item_data_1011 = {
+	.pdu = select_item_1011,
+	.pdu_len = sizeof(select_item_1011),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.items[0] = {
+		.id = 1,
+		.text = "ЗДРАВСТВУЙТЕ1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "ЗДРАВСТВУЙТЕ2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "ЗДРАВСТВУЙТЕ3"
+	}
+};
+
+static struct select_item_test select_item_data_1021 = {
+	.pdu = select_item_1021,
+	.pdu_len = sizeof(select_item_1021),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.items[0] = {
+		.id = 1,
+		.text = "ЗДРАВСТВУЙТЕ1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "ЗДРАВСТВУЙТЕ2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "ЗДРАВСТВУЙТЕ3"
+	}
+};
+
+static struct select_item_test select_item_data_1031 = {
+	.pdu = select_item_1031,
+	.pdu_len = sizeof(select_item_1031),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.items[0] = {
+		.id = 1,
+		.text = "ЗДРАВСТВУЙТЕ1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "ЗДРАВСТВУЙТЕ2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "ЗДРАВСТВУЙТЕ3"
+	}
+};
+
+static struct select_item_test select_item_data_1111 = {
+	.pdu = select_item_1111,
+	.pdu_len = sizeof(select_item_1111),
+	.qualifier = 0x00,
+	.alpha_id = "工具箱选择",
+	.items[0] = {
+		.id = 1,
+		.text = "项目一"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "项目二"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "项目三"
+	},
+	.items[3] = {
+		.id = 4,
+		.text = "项目四"
+	}
+};
+
+static struct select_item_test select_item_data_1211 = {
+	.pdu = select_item_1211,
+	.pdu_len = sizeof(select_item_1211),
+	.qualifier = 0x00,
+	.alpha_id = "80ル0",
+	.items[0] = {
+		.id = 1,
+		.text = "80ル1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "80ル2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "80ル3"
+	}
+};
+
+static struct select_item_test select_item_data_1221 = {
+	.pdu = select_item_1221,
+	.pdu_len = sizeof(select_item_1221),
+	.qualifier = 0x00,
+	.alpha_id = "81ル0",
+	.items[0] = {
+		.id = 1,
+		.text = "81ル1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "81ル2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "81ル3"
+	}
+};
+
+static struct select_item_test select_item_data_1231 = {
+	.pdu = select_item_1231,
+	.pdu_len = sizeof(select_item_1231),
+	.qualifier = 0x00,
+	.alpha_id = "82ル0",
+	.items[0] = {
+		.id = 1,
+		.text = "82ル1"
+	},
+	.items[1] = {
+		.id = 2,
+		.text = "82ル2"
+	},
+	.items[2] = {
+		.id = 3,
+		.text = "82ル3"
+	}
+};
+
+static void test_select_item(gconstpointer data)
+{
+	const struct select_item_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_SELECT_ITEM);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	check_common_text(command->select_item.alpha_id, test->alpha_id);
+	check_items(command->select_item.items, test->items);
+	check_items_next_action_indicator(&command->select_item.next_act,
+						&test->next_act);
+	check_item_id(command->select_item.item_id, test->item_id);
+	check_icon_id(&command->select_item.icon_id, &test->icon_id);
+	check_item_icon_id_list(&command->select_item.item_icon_id_list,
+					&test->item_icon_id_list);
+	check_text_attr(&command->select_item.text_attr, &test->text_attr);
+	check_item_text_attribute_list(
+				&command->select_item.item_text_attr_list,
+				&test->item_text_attr_list);
+	check_frame_id(&command->select_item.frame_id, &test->frame_id);
+
+	stk_command_free(command);
+}
+
 struct send_sms_test {
 	const unsigned char *pdu;
 	unsigned int pdu_len;
@@ -5983,6 +7921,103 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Setup Menu 9.1.3",
 				&setup_menu_data_913, test_setup_menu);
 
+	g_test_add_data_func("/teststk/Select Item 1.1.1",
+				&select_item_data_111, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 1.2.1",
+				&select_item_data_121, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 1.3.1",
+				&select_item_data_131, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 1.4.1",
+				&select_item_data_141, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 1.5.1",
+				&select_item_data_151, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 1.6.1",
+				&select_item_data_161, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 2.1.1",
+				&select_item_data_211, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 3.1.1",
+				&select_item_data_311, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 4.1.1",
+				&select_item_data_411, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 5.1.1",
+				&select_item_data_511, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 5.2.1",
+				&select_item_data_521, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 6.1.1",
+				&select_item_data_611, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 6.2.1",
+				&select_item_data_621, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 7.1.1",
+				&select_item_data_711, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 8.1.1",
+				&select_item_data_811, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.1.1",
+				&select_item_data_911, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.1.2",
+				&select_item_data_912, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.2.1",
+				&select_item_data_921, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.2.2",
+				&select_item_data_922, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.3.1",
+				&select_item_data_931, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.3.2",
+				&select_item_data_932, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.4.1",
+				&select_item_data_941, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.4.2",
+				&select_item_data_942, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.4.3",
+				&select_item_data_943, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.5.1",
+				&select_item_data_951, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.5.2",
+				&select_item_data_952, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.5.3",
+				&select_item_data_953, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.6.1",
+				&select_item_data_961, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.6.2",
+				&select_item_data_962, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.6.3",
+				&select_item_data_963, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.7.1",
+				&select_item_data_971, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.7.2",
+				&select_item_data_972, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.7.3",
+				&select_item_data_973, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.8.1",
+				&select_item_data_981, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.8.2",
+				&select_item_data_982, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.8.3",
+				&select_item_data_983, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.9.1",
+				&select_item_data_991, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.9.2",
+				&select_item_data_992, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.9.3",
+				&select_item_data_993, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.10.1",
+				&select_item_data_9101, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 9.10.2",
+				&select_item_data_9102, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 10.1.1",
+				&select_item_data_1011, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 10.2.1",
+				&select_item_data_1021, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 10.3.1",
+				&select_item_data_1031, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 11.1.1",
+				&select_item_data_1111, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 12.1.1",
+				&select_item_data_1211, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 12.2.1",
+				&select_item_data_1221, test_select_item);
+	g_test_add_data_func("/teststk/Select Item 12.3.1",
+				&select_item_data_1231, test_select_item);
+
 	g_test_add_data_func("/teststk/Send SMS 1.1",
 				&send_sms_data_11, test_send_sms);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 07/27] test-stkutil: Use dedicated functions to check
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (4 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 06/27] test-stkutil: Add test for select item parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 08/27] test-stkutil: Refactor test for send sms parser Yang Gu
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 5348 bytes --]

---
 unit/test-stkutil.c |   50 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 2fa449d..8ec380f 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -71,6 +71,12 @@ static inline void check_common_text(const char *command, const char *test)
 	g_assert(g_str_equal(command, test));
 }
 
+/* Defined in TS 102.223 Section 8.2 */
+static inline void check_alpha_id(const char *command, const char *test)
+{
+	check_common_text(command, test);
+}
+
 /* Defined in TS 102.223 Section 8.8 */
 static void check_duration(const struct stk_duration *command,
 					const struct stk_duration *test)
@@ -116,6 +122,25 @@ static void check_response_length(const struct stk_response_length *command,
 	g_assert(command->max == test->max);
 }
 
+/* Defined in TS 102.223 Section 8.15 */
+static inline void check_text(const char *command, const char *test)
+{
+	check_common_text(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.16 */
+static inline void check_tone(const ofono_bool_t command,
+					const ofono_bool_t test)
+{
+	check_common_bool(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.23 */
+static inline void check_default_text(const char *command, const char *test)
+{
+	check_common_text(command, test);
+}
+
 /* Defined in TS 102.223 Section 8.24 */
 static void check_items_next_action_indicator(
 			const struct stk_items_next_action_indicator *command,
@@ -142,6 +167,13 @@ static void check_item_icon_id_list(const struct stk_item_icon_id_list *command,
 	g_assert(g_mem_equal(command->list, test->list, test->len));
 }
 
+/* Defined in TS 102.223 Section 8.43 */
+static inline void check_imm_resp(const unsigned char command,
+					const unsigned char test)
+{
+	check_common_byte(command, test);
+}
+
 /* Defined in TS 102.223 Section 8.72 */
 static void check_text_attr(const struct stk_text_attribute *command,
 					const struct stk_text_attribute *test)
@@ -410,9 +442,9 @@ static void test_display_text(gconstpointer data)
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_DISPLAY);
 
 	g_assert(command->display_text.text);
-	check_common_text(command->display_text.text, test->text);
+	check_text(command->display_text.text, test->text);
 	check_icon_id(&command->display_text.icon_id, &test->icon_id);
-	check_common_bool(command->display_text.immediate_response,
+	check_imm_resp(command->display_text.immediate_response,
 						test->immediate_response);
 	check_duration(&command->display_text.duration, &test->duration);
 	check_text_attr(&command->display_text.text_attr,
@@ -1347,7 +1379,7 @@ static void test_get_inkey(gconstpointer data)
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
 
 	g_assert(command->get_inkey.text);
-	check_common_text(command->get_inkey.text, test->text);
+	check_text(command->get_inkey.text, test->text);
 	check_icon_id(&command->get_inkey.icon_id, &test->icon_id);
 	check_duration(&command->get_inkey.duration, &test->duration);
 	check_text_attr(&command->get_inkey.text_attr,
@@ -2653,9 +2685,9 @@ static void test_get_input(gconstpointer data)
 
 	if (test->text)
 		g_assert(command->get_input.text);
-	check_common_text(command->get_input.text, test->text);
+	check_text(command->get_input.text, test->text);
 	check_response_length(&command->get_input.resp_len, &test->resp_len);
-	check_common_text(command->get_input.default_text, test->default_text);
+	check_default_text(command->get_input.default_text, test->default_text);
 	check_icon_id(&command->get_input.icon_id, &test->icon_id);
 	check_text_attr(&command->get_input.text_attr,
 						&test->text_attr);
@@ -3931,8 +3963,8 @@ static void test_play_tone(gconstpointer data)
 	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_EARPIECE);
 
-	check_common_text(command->play_tone.alpha_id, test->alpha_id);
-	check_common_byte(command->play_tone.tone, test->tone);
+	check_alpha_id(command->play_tone.alpha_id, test->alpha_id);
+	check_tone(command->play_tone.tone, test->tone);
 	check_duration(&command->play_tone.duration, &test->duration);
 	check_icon_id(&command->play_tone.icon_id, &test->icon_id);
 	check_text_attr(&command->play_tone.text_attr, &test->text_attr);
@@ -5464,7 +5496,7 @@ static void test_setup_menu(gconstpointer data)
 
 	if (test->alpha_id)
 		g_assert(command->setup_menu.alpha_id);
-	check_common_text(command->setup_menu.alpha_id, test->alpha_id);
+	check_alpha_id(command->setup_menu.alpha_id, test->alpha_id);
 	check_items(command->setup_menu.items, test->items);
 	check_items_next_action_indicator(&command->setup_menu.next_act,
 						&test->next_act);
@@ -7392,7 +7424,7 @@ static void test_select_item(gconstpointer data)
 	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
 
-	check_common_text(command->select_item.alpha_id, test->alpha_id);
+	check_alpha_id(command->select_item.alpha_id, test->alpha_id);
 	check_items(command->select_item.items, test->items);
 	check_items_next_action_indicator(&command->select_item.next_act,
 						&test->next_act);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 08/27] test-stkutil: Refactor test for send sms parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (5 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 07/27] test-stkutil: Use dedicated functions to check Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 09/27] stk: Adjust the sequence of dataobj Yang Gu
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 6459 bytes --]

---
 unit/test-stkutil.c |  132 ++++++++++++++++++++++++++++++++------------------
 1 files changed, 84 insertions(+), 48 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 8ec380f..82df2e3 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -71,6 +71,27 @@ static inline void check_common_text(const char *command, const char *test)
 	g_assert(g_str_equal(command, test));
 }
 
+static inline void check_common_byte_array(
+				const struct stk_common_byte_array *command,
+				const struct stk_common_byte_array *test)
+{
+	if (test->len == 0) {
+		g_assert(command->len == 0);
+		return;
+	}
+
+	g_assert(command->len != 0);
+	g_assert(g_mem_equal(command->array, test->array, test->len));
+}
+
+/* Defined in TS 102.223 Section 8.1 */
+static inline void check_address(const struct stk_address *command,
+					const struct stk_address *test)
+{
+	g_assert(command->ton_npi == test->ton_npi);
+	g_assert(g_str_equal(command->number, test->number));
+}
+
 /* Defined in TS 102.223 Section 8.2 */
 static inline void check_alpha_id(const char *command, const char *test)
 {
@@ -122,6 +143,18 @@ static void check_response_length(const struct stk_response_length *command,
 	g_assert(command->max == test->max);
 }
 
+/* Defined in TS 102.223 Section 8.13 */
+static void check_gsm_sms_tpdu(const struct sms *command,
+					const struct sms *test)
+{
+	g_assert(command->submit.mr == test->submit.mr);
+	g_assert(command->submit.udl == test->submit.udl);
+	g_assert(g_str_equal(command->submit.daddr.address,
+					test->submit.daddr.address));
+	g_assert(g_mem_equal(command->submit.ud, test->submit.ud,
+					test->submit.udl));
+}
+
 /* Defined in TS 102.223 Section 8.15 */
 static inline void check_text(const char *command, const char *test)
 {
@@ -174,6 +207,14 @@ static inline void check_imm_resp(const unsigned char command,
 	check_common_byte(command, test);
 }
 
+/* Defined in TS 102.223 Section 8.71 */
+static inline void check_cdma_sms_tpdu(
+				const struct stk_common_byte_array *command,
+				const struct stk_common_byte_array *test)
+{
+	check_common_byte_array(command, test);
+}
+
 /* Defined in TS 102.223 Section 8.72 */
 static void check_text_attr(const struct stk_text_attribute *command,
 					const struct stk_text_attribute *test)
@@ -7445,45 +7486,51 @@ struct send_sms_test {
 	const unsigned char *pdu;
 	unsigned int pdu_len;
 	unsigned char qualifier;
-	const char *alpha_id;
-	unsigned char ton_npi;
-	const char *address;
-	unsigned char sms_mr;
-	const char *sms_address;
-	unsigned char sms_udl;
-	const char *sms_ud;
+	char *alpha_id;
+	struct stk_address address;
+	struct sms gsm_sms;
+	struct stk_common_byte_array cdma_sms;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
 };
 
 /* 3GPP TS 31.124 Section 27.22.4.10.1.4.2 */
-static unsigned char send_sms_11[] = { 0xD0, 0x37, 0x81, 0x03, 0x01, 0x13, 0x00,
-					0x82, 0x02, 0x81, 0x83, 0x85, 0x07,
-					0x53, 0x65, 0x6E, 0x64, 0x20, 0x53,
-					0x4D, 0x86, 0x09, 0x91, 0x11, 0x22,
-					0x33, 0x44, 0x55, 0x66, 0x77, 0xF8,
-					0x8B, 0x18, 0x01, 0x00, 0x09, 0x91,
-					0x10, 0x32, 0x54, 0x76, 0xF8, 0x40,
-					0xF4, 0x0C, 0x54, 0x65, 0x73, 0x74,
-					0x20, 0x4D, 0x65, 0x73, 0x73, 0x61,
-					0x67, 0x65 };
-
-static struct send_sms_test send_sms_data_11 = {
-	.pdu = send_sms_11,
-	.pdu_len = sizeof(send_sms_11),
+static unsigned char send_sms_111[] = { 0xD0, 0x37, 0x81, 0x03, 0x01, 0x13,
+					0x00, 0x82, 0x02, 0x81, 0x83, 0x85,
+					0x07, 0x53, 0x65, 0x6E, 0x64, 0x20,
+					0x53, 0x4D, 0x86, 0x09, 0x91, 0x11,
+					0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+					0xF8, 0x8B, 0x18, 0x01, 0x00, 0x09,
+					0x91, 0x10, 0x32, 0x54, 0x76, 0xF8,
+					0x40, 0xF4, 0x0C, 0x54, 0x65, 0x73,
+					0x74, 0x20, 0x4D, 0x65, 0x73, 0x73,
+					0x61, 0x67, 0x65 };
+
+static struct send_sms_test send_sms_data_111 = {
+	.pdu = send_sms_111,
+	.pdu_len = sizeof(send_sms_111),
 	.qualifier = 0x00,
 	.alpha_id = "Send SM",
-	.ton_npi = 0x91,
-	.address = "112233445566778",
-	.sms_mr = 0x00,
-	.sms_address = "012345678",
-	.sms_udl = 12,
-	.sms_ud = "Test Message",
+	.address = {
+		.ton_npi = 0x91,
+		.number = "112233445566778"
+	},
+	.gsm_sms = {
+		{}, SMS_TYPE_SUBMIT,
+		{.submit = {
+			.mr = 0x00,
+			.daddr.address = "012345678",
+			.udl = 12,
+			.ud = "Test Message"
+		} }
+	}
 };
 
 static void test_send_sms(gconstpointer data)
 {
 	const struct send_sms_test *test = data;
 	struct stk_command *command;
-	int i;
 
 	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
 
@@ -7496,24 +7543,13 @@ static void test_send_sms(gconstpointer data)
 	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
 
-	if (test->alpha_id)
-		g_assert(g_str_equal(test->alpha_id,
-					command->send_sms.alpha_id));
-
-	if (test->address) {
-		g_assert(test->ton_npi == command->send_sms.address.ton_npi);
-		g_assert(g_str_equal(test->address,
-					command->send_sms.address.number));
-	}
-
-	g_assert(test->sms_mr == command->send_sms.gsm_sms.submit.mr);
-	g_assert(test->sms_udl == command->send_sms.gsm_sms.submit.udl);
-	g_assert(g_str_equal(test->sms_address,
-			command->send_sms.gsm_sms.submit.daddr.address));
-
-	for (i = 0; i < test->sms_udl; i++)
-		g_assert(test->sms_ud[i] ==
-				command->send_sms.gsm_sms.submit.ud[i]);
+	check_alpha_id(command->send_sms.alpha_id, test->alpha_id);
+	check_address(&command->send_sms.address, &test->address);
+	check_gsm_sms_tpdu(&command->send_sms.gsm_sms, &test->gsm_sms);
+	check_cdma_sms_tpdu(&command->send_sms.cdma_sms, &test->cdma_sms);
+	check_icon_id(&command->select_item.icon_id, &test->icon_id);
+	check_text_attr(&command->select_item.text_attr, &test->text_attr);
+	check_frame_id(&command->select_item.frame_id, &test->frame_id);
 
 	stk_command_free(command);
 }
@@ -8050,8 +8086,8 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Select Item 12.3.1",
 				&select_item_data_1231, test_select_item);
 
-	g_test_add_data_func("/teststk/Send SMS 1.1",
-				&send_sms_data_11, test_send_sms);
+	g_test_add_data_func("/teststk/Send SMS 1.1.1",
+				&send_sms_data_111, test_send_sms);
 
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 09/27] stk: Adjust the sequence of dataobj
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (6 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 08/27] test-stkutil: Refactor test for send sms parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 10/27] stkutil: Add setup call proactive command parser Yang Gu
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]

---
 src/stkutil.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/stkutil.h b/src/stkutil.h
index d017dc9..0c9fd50 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -872,10 +872,10 @@ struct stk_command {
 		struct stk_command_get_inkey get_inkey;
 		struct stk_command_get_input get_input;
 		struct stk_command_play_tone play_tone;
-		struct stk_command_select_item select_item;
-		struct stk_command_send_sms send_sms;
 		struct stk_command_poll_interval poll_interval;
 		struct stk_command_setup_menu setup_menu;
+		struct stk_command_select_item select_item;
+		struct stk_command_send_sms send_sms;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 10/27] stkutil: Add setup call proactive command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (7 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 09/27] stk: Adjust the sequence of dataobj Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 11/27] test-stkutil: Add unit test for setup call parser Yang Gu
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3353 bytes --]

---
 src/stkutil.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/stkutil.h |   15 +++++++++++++++
 2 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 1b2297d..39278e7 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2501,6 +2501,58 @@ static gboolean parse_send_sms(struct stk_command *command,
 	return TRUE;
 }
 
+static void destroy_setup_call(struct stk_command *command)
+{
+	g_free(command->setup_call.alpha_id_usr_cfm);
+	g_free(command->setup_call.addr.number);
+	g_free(command->setup_call.alpha_id_call_setup);
+}
+
+static gboolean parse_setup_call(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_setup_call *obj = &command->setup_call;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_NETWORK)
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+				&obj->alpha_id_usr_cfm,
+				STK_DATA_OBJECT_TYPE_ADDRESS,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->addr,
+				STK_DATA_OBJECT_TYPE_CCP, 0,
+				&obj->ccp,
+				STK_DATA_OBJECT_TYPE_SUBADDRESS, 0,
+				&obj->subaddr,
+				STK_DATA_OBJECT_TYPE_DURATION, 0,
+				&obj->duration,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id_usr_cfm,
+				STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+				&obj->alpha_id_call_setup,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id_call_setup,
+				STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+				&obj->text_attr_usr_cfm,
+				STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+				&obj->text_attr_call_setup,
+				STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+				&obj->frame_id,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	command->destructor = destroy_setup_call;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2586,6 +2638,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_SEND_SMS:
 		ok = parse_send_sms(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_SETUP_CALL:
+		ok = parse_setup_call(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 0c9fd50..d0d2486 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -860,6 +860,20 @@ struct stk_command_send_sms {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_setup_call {
+	char *alpha_id_usr_cfm;
+	struct stk_address addr;
+	struct stk_ccp ccp;
+	struct stk_subaddress subaddr;
+	struct stk_duration duration;
+	struct stk_icon_id icon_id_usr_cfm;
+	char *alpha_id_call_setup;
+	struct stk_icon_id icon_id_call_setup;
+	struct stk_text_attribute text_attr_usr_cfm;
+	struct stk_text_attribute text_attr_call_setup;
+	struct stk_frame_id frame_id;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -876,6 +890,7 @@ struct stk_command {
 		struct stk_command_setup_menu setup_menu;
 		struct stk_command_select_item select_item;
 		struct stk_command_send_sms send_sms;
+		struct stk_command_setup_call setup_call;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 11/27] test-stkutil: Add unit test for setup call parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (8 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 10/27] stkutil: Add setup call proactive command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 12/27] stkutil: Add refresh proactive command parser Yang Gu
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 45157 bytes --]

---
 unit/test-stkutil.c | 1395 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1395 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 82df2e3..75ca258 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -98,6 +98,32 @@ static inline void check_alpha_id(const char *command, const char *test)
 	check_common_text(command, test);
 }
 
+/* Defined in TS 102.223 Section 8.3 */
+static void check_subaddress(const struct stk_subaddress *command,
+					const struct stk_subaddress *test)
+{
+	if (test->len == 0) {
+		g_assert(command->len == 0);
+		return;
+	}
+
+	g_assert(command->len != 0);
+	g_assert(g_mem_equal(command->subaddr, test->subaddr, test->len));
+}
+
+/* Defined in TS 102.223 Section 8.4 */
+static void check_ccp(const struct stk_ccp *command,
+					const struct stk_ccp *test)
+{
+	if (test->len == 0) {
+		g_assert(command->len == 0);
+		return;
+	}
+
+	g_assert(command->len != 0);
+	g_assert(g_mem_equal(command->ccp, test->ccp, test->len));
+}
+
 /* Defined in TS 102.223 Section 8.8 */
 static void check_duration(const struct stk_duration *command,
 					const struct stk_duration *test)
@@ -7554,6 +7580,1284 @@ static void test_send_sms(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct setup_call_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	char *alpha_id_usr_cfm;
+	struct stk_address addr;
+	struct stk_ccp ccp;
+	struct stk_subaddress subaddr;
+	struct stk_duration duration;
+	struct stk_icon_id icon_id_usr_cfm;
+	char *alpha_id_call_setup;
+	struct stk_icon_id icon_id_call_setup;
+	struct stk_text_attribute text_attr_usr_cfm;
+	struct stk_text_attribute text_attr_call_setup;
+	struct stk_frame_id frame_id;
+};
+
+static unsigned char setup_call_111[] = { 0xD0, 0x1E, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x08, 0x4E, 0x6F, 0x74,
+						0x20, 0x62, 0x75, 0x73, 0x79,
+						0x86, 0x09, 0x91, 0x10, 0x32,
+						0x04, 0x21, 0x43, 0x65, 0x1C,
+						0x2C };
+
+static unsigned char setup_call_141[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x10,
+						0x02, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x07, 0x4F, 0x6E, 0x20,
+						0x68, 0x6F, 0x6C, 0x64, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C };
+
+static unsigned char setup_call_151[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x10,
+						0x04, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x44, 0x69, 0x73,
+						0x63, 0x6F, 0x6E, 0x6E, 0x65,
+						0x63, 0x74, 0x86, 0x09, 0x91,
+						0x10, 0x32, 0x04, 0x21, 0x43,
+						0x65, 0x1C, 0x2C };
+
+static unsigned char setup_call_181[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x11, 0x43, 0x61, 0x70,
+						0x61, 0x62, 0x69, 0x6C, 0x69,
+						0x74, 0x79, 0x20, 0x63, 0x6F,
+						0x6E, 0x66, 0x69, 0x67, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x87, 0x02, 0x01, 0xA0 };
+
+static unsigned char setup_call_191[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x10,
+						0x01, 0x82, 0x02, 0x81, 0x83,
+						0x86, 0x11, 0x91, 0x10, 0x32,
+						0x54, 0x76, 0x98, 0x10, 0x32,
+						0x54, 0x76, 0x98, 0x10, 0x32,
+						0x54, 0x76, 0x98, 0x10 };
+
+static unsigned char setup_call_1101[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
+						0x10, 0x01, 0x82, 0x02, 0x81,
+						0x83, 0x85, 0x81, 0xED, 0x54,
+						0x68, 0x72, 0x65, 0x65, 0x20,
+						0x74, 0x79, 0x70, 0x65, 0x73,
+						0x20, 0x61, 0x72, 0x65, 0x20,
+						0x64, 0x65, 0x66, 0x69, 0x6E,
+						0x65, 0x64, 0x3A, 0x20, 0x2D,
+						0x20, 0x73, 0x65, 0x74, 0x20,
+						0x75, 0x70, 0x20, 0x61, 0x20,
+						0x63, 0x61, 0x6C, 0x6C, 0x2C,
+						0x20, 0x62, 0x75, 0x74, 0x20,
+						0x6F, 0x6E, 0x6C, 0x79, 0x20,
+						0x69, 0x66, 0x20, 0x6E, 0x6F,
+						0x74, 0x20, 0x63, 0x75, 0x72,
+						0x72, 0x65, 0x6E, 0x74, 0x6C,
+						0x79, 0x20, 0x62, 0x75, 0x73,
+						0x79, 0x20, 0x6F, 0x6E, 0x20,
+						0x61, 0x6E, 0x6F, 0x74, 0x68,
+						0x65, 0x72, 0x20, 0x63, 0x61,
+						0x6C, 0x6C, 0x3B, 0x20, 0x2D,
+						0x20, 0x73, 0x65, 0x74, 0x20,
+						0x75, 0x70, 0x20, 0x61, 0x20,
+						0x63, 0x61, 0x6C, 0x6C, 0x2C,
+						0x20, 0x70, 0x75, 0x74, 0x74,
+						0x69, 0x6E, 0x67, 0x20, 0x61,
+						0x6C, 0x6C, 0x20, 0x6F, 0x74,
+						0x68, 0x65, 0x72, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x73, 0x20,
+						0x28, 0x69, 0x66, 0x20, 0x61,
+						0x6E, 0x79, 0x29, 0x20, 0x6F,
+						0x6E, 0x20, 0x68, 0x6F, 0x6C,
+						0x64, 0x3B, 0x20, 0x2D, 0x20,
+						0x73, 0x65, 0x74, 0x20, 0x75,
+						0x70, 0x20, 0x61, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x2C, 0x20,
+						0x64, 0x69, 0x73, 0x63, 0x6F,
+						0x6E, 0x6E, 0x65, 0x63, 0x74,
+						0x69, 0x6E, 0x67, 0x20, 0x61,
+						0x6C, 0x6C, 0x20, 0x6F, 0x74,
+						0x68, 0x65, 0x72, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x73, 0x20,
+						0x28, 0x69, 0x66, 0x20, 0x61,
+						0x6E, 0x79, 0x29, 0x20, 0x66,
+						0x69, 0x72, 0x73, 0x74, 0x2E,
+						0x20, 0x46, 0x6F, 0x72, 0x20,
+						0x65, 0x61, 0x63, 0x68, 0x20,
+						0x6F, 0x66, 0x20, 0x74, 0x68,
+						0x65, 0x73, 0x65, 0x20, 0x74,
+						0x79, 0x70, 0x65, 0x73, 0x2C,
+						0x20, 0x86, 0x02, 0x91, 0x10 };
+
+static unsigned char setup_call_1111[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0C, 0x43, 0x61, 0x6C,
+						0x6C, 0x65, 0x64, 0x20, 0x70,
+						0x61, 0x72, 0x74, 0x79, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x88, 0x07, 0x80, 0x50, 0x95,
+						0x95, 0x95, 0x95, 0x95 };
+
+static unsigned char setup_call_1121[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x10,
+						0x01, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x08, 0x44, 0x75, 0x72,
+						0x61, 0x74, 0x69, 0x6F, 0x6E,
+						0x86, 0x09, 0x91, 0x10, 0x32,
+						0x04, 0x21, 0x43, 0x65, 0x1C,
+						0x2C, 0x84, 0x02, 0x01, 0x0A };
+
+static unsigned char setup_call_211[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0C, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x85, 0x04, 0x43, 0x41, 0x4C,
+						0x4C };
+
+static unsigned char setup_call_311[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x16, 0x53, 0x65, 0x74,
+						0x20, 0x75, 0x70, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x20, 0x49,
+						0x63, 0x6F, 0x6E, 0x20, 0x33,
+						0x2E, 0x31, 0x2E, 0x31, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x9E, 0x02, 0x01, 0x01 };
+
+static unsigned char setup_call_321[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x16, 0x53, 0x65, 0x74,
+						0x20, 0x75, 0x70, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x20, 0x49,
+						0x63, 0x6F, 0x6E, 0x20, 0x33,
+						0x2E, 0x32, 0x2E, 0x31, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x9E, 0x02, 0x00, 0x01 };
+
+static unsigned char setup_call_331[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x16, 0x53, 0x65, 0x74,
+						0x20, 0x75, 0x70, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x20, 0x49,
+						0x63, 0x6F, 0x6E, 0x20, 0x33,
+						0x2E, 0x33, 0x2E, 0x31, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x9E, 0x02, 0x01, 0x02 };
+
+static unsigned char setup_call_341[] = { 0xD0, 0x4C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x16, 0x53, 0x65, 0x74,
+						0x20, 0x75, 0x70, 0x20, 0x63,
+						0x61, 0x6C, 0x6C, 0x20, 0x49,
+						0x63, 0x6F, 0x6E, 0x20, 0x33,
+						0x2E, 0x34, 0x2E, 0x31, 0x86,
+						0x09, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x1C, 0x2C,
+						0x9E, 0x02, 0x00, 0x01, 0x85,
+						0x16, 0x53, 0x65, 0x74, 0x20,
+						0x75, 0x70, 0x20, 0x63, 0x61,
+						0x6C, 0x6C, 0x20, 0x49, 0x63,
+						0x6F, 0x6E, 0x20, 0x33, 0x2E,
+						0x34, 0x2E, 0x32, 0x9E, 0x02,
+						0x00, 0x01 };
+
+static unsigned char setup_call_411[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_412[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32 };
+
+static unsigned char setup_call_421[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x01,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x01, 0xB4 };
+
+static unsigned char setup_call_422[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32 };
+
+static unsigned char setup_call_431[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x02,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x02, 0xB4 };
+
+static unsigned char setup_call_432[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32 };
+
+static unsigned char setup_call_441[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x04,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x04, 0xB4 };
+
+static unsigned char setup_call_442[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_443[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x33, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x33 };
+
+static unsigned char setup_call_451[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x08,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x08, 0xB4 };
+
+static unsigned char setup_call_452[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_453[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x33, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x33 };
+
+static unsigned char setup_call_461[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x10,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x10, 0xB4 };
+
+static unsigned char setup_call_462[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_463[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x33, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x33 };
+
+static unsigned char setup_call_471[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x20,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x20, 0xB4 };
+
+static unsigned char setup_call_472[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_473[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x33, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x33 };
+
+static unsigned char setup_call_481[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x40,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x40, 0xB4 };
+
+static unsigned char setup_call_482[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_483[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x33, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x33 };
+
+static unsigned char setup_call_491[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x80,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x80, 0xB4 };
+
+static unsigned char setup_call_492[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0xB4 };
+
+static unsigned char setup_call_493[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x33, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x33 };
+
+static unsigned char setup_call_4101[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x31, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x31,
+						0xD0, 0x04, 0x00, 0x0E, 0x00,
+						0xB4, 0xD0, 0x04, 0x00, 0x06,
+						0x00, 0x4B };
+
+static unsigned char setup_call_4102[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0E, 0x43, 0x4F, 0x4E,
+						0x46, 0x49, 0x52, 0x4D, 0x41,
+						0x54, 0x49, 0x4F, 0x4E, 0x20,
+						0x32, 0x86, 0x09, 0x91, 0x10,
+						0x32, 0x04, 0x21, 0x43, 0x65,
+						0x1C, 0x2C, 0x85, 0x06, 0x43,
+						0x41, 0x4C, 0x4C, 0x20, 0x32 };
+
+static unsigned char setup_call_511[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x19, 0x80, 0x04, 0x17,
+						0x04, 0x14, 0x04, 0x20, 0x04,
+						0x10, 0x04, 0x12, 0x04, 0x21,
+						0x04, 0x22, 0x04, 0x12, 0x04,
+						0x23, 0x04, 0x19, 0x04, 0x22,
+						0x04, 0x15, 0x86, 0x07, 0x91,
+						0x10, 0x32, 0x04, 0x21, 0x43,
+						0x65 };
+
+static unsigned char setup_call_521[] = { 0xD0, 0x4C, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x1B, 0x80, 0x04, 0x17,
+						0x04, 0x14, 0x04, 0x20, 0x04,
+						0x10, 0x04, 0x12, 0x04, 0x21,
+						0x04, 0x22, 0x04, 0x12, 0x04,
+						0x23, 0x04, 0x19, 0x04, 0x22,
+						0x04, 0x15, 0x00, 0x31, 0x86,
+						0x07, 0x91, 0x10, 0x32, 0x04,
+						0x21, 0x43, 0x65, 0x85, 0x1B,
+						0x80, 0x04, 0x17, 0x04, 0x14,
+						0x04, 0x20, 0x04, 0x10, 0x04,
+						0x12, 0x04, 0x21, 0x04, 0x22,
+						0x04, 0x12, 0x04, 0x23, 0x04,
+						0x19, 0x04, 0x22, 0x04, 0x15,
+						0x00, 0x32 };
+
+static unsigned char setup_call_611[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x05, 0x80, 0x4E, 0x0D,
+						0x5F, 0xD9, 0x86, 0x07, 0x91,
+						0x10, 0x32, 0x04, 0x21, 0x43,
+						0x65 };
+
+static unsigned char setup_call_621[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x05, 0x80, 0x78, 0x6E,
+						0x5B, 0x9A, 0x86, 0x07, 0x91,
+						0x10, 0x32, 0x04, 0x21, 0x43,
+						0x65, 0x85, 0x07, 0x80, 0x62,
+						0x53, 0x75, 0x35, 0x8B, 0xDD };
+
+static unsigned char setup_call_711[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x03, 0x80, 0x30, 0xEB,
+						0x86, 0x07, 0x91, 0x10, 0x32,
+						0x04, 0x21, 0x43, 0x65 };
+
+static unsigned char setup_call_721[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x10,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x05, 0x80, 0x30, 0xEB,
+						0x00, 0x31, 0x86, 0x07, 0x91,
+						0x10, 0x32, 0x04, 0x21, 0x43,
+						0x65, 0x85, 0x05, 0x80, 0x30,
+						0xEB, 0x00, 0x32 };
+
+static struct setup_call_test setup_call_data_111 = {
+	.pdu = setup_call_111,
+	.pdu_len = sizeof(setup_call_111),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Not busy",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	}
+};
+
+static struct setup_call_test setup_call_data_141 = {
+	.pdu = setup_call_141,
+	.pdu_len = sizeof(setup_call_141),
+	.qualifier = 0x02,
+	.alpha_id_usr_cfm = "On hold",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	}
+};
+
+static struct setup_call_test setup_call_data_151 = {
+	.pdu = setup_call_151,
+	.pdu_len = sizeof(setup_call_151),
+	.qualifier = 0x04,
+	.alpha_id_usr_cfm = "Disconnect",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	}
+};
+
+static struct setup_call_test setup_call_data_181 = {
+	.pdu = setup_call_181,
+	.pdu_len = sizeof(setup_call_181),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Capability config",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.ccp = {
+		.len = 0x02,
+		.ccp = { 0x01, 0xA0 }
+	}
+};
+
+static struct setup_call_test setup_call_data_191 = {
+	.pdu = setup_call_191,
+	.pdu_len = sizeof(setup_call_191),
+	.qualifier = 0x01,
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "01234567890123456789012345678901"
+	}
+};
+
+static struct setup_call_test setup_call_data_1101 = {
+	.pdu = setup_call_1101,
+	.pdu_len = sizeof(setup_call_1101),
+	.qualifier = 0x01,
+	.alpha_id_usr_cfm = "Three types are defined: - set up a call, but "
+			"only if not currently busy on another call; - set "
+			"up a call, putting all other calls (if any) on hold; "
+			"- set up a call, disconnecting all other calls (if "
+			"any) first. For each of these types, ",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "01"
+	}
+};
+
+static struct setup_call_test setup_call_data_1111 = {
+	.pdu = setup_call_1111,
+	.pdu_len = sizeof(setup_call_1111),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Called party",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.subaddr = {
+		.len = 0x07,
+		.subaddr = { 0x80, 0x50, 0x95, 0x95, 0x95, 0x95, 0x95 }
+	}
+};
+
+static struct setup_call_test setup_call_data_1121 = {
+	.pdu = setup_call_1121,
+	.pdu_len = sizeof(setup_call_1121),
+	.qualifier = 0x01,
+	.alpha_id_usr_cfm = "Duration",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.duration = {
+		.unit = STK_DURATION_TYPE_SECONDS,
+		.interval = 10,
+	}
+};
+
+static struct setup_call_test setup_call_data_211 = {
+	.pdu = setup_call_211,
+	.pdu_len = sizeof(setup_call_211),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL"
+};
+
+static struct setup_call_test setup_call_data_311 = {
+	.pdu = setup_call_311,
+	.pdu_len = sizeof(setup_call_311),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Set up call Icon 3.1.1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.icon_id_usr_cfm = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct setup_call_test setup_call_data_321 = {
+	.pdu = setup_call_321,
+	.pdu_len = sizeof(setup_call_321),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Set up call Icon 3.2.1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.icon_id_usr_cfm = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct setup_call_test setup_call_data_331 = {
+	.pdu = setup_call_331,
+	.pdu_len = sizeof(setup_call_331),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Set up call Icon 3.3.1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.icon_id_usr_cfm = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 0x02
+	}
+};
+
+static struct setup_call_test setup_call_data_341 = {
+	.pdu = setup_call_341,
+	.pdu_len = sizeof(setup_call_341),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "Set up call Icon 3.4.1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.icon_id_usr_cfm = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x01
+	},
+	.alpha_id_call_setup = "Set up call Icon 3.4.2",
+	.icon_id_call_setup = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct setup_call_test setup_call_data_411 = {
+	.pdu = setup_call_411,
+	.pdu_len = sizeof(setup_call_411),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_412 = {
+	.pdu = setup_call_412,
+	.pdu_len = sizeof(setup_call_412),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2"
+};
+
+static struct setup_call_test setup_call_data_421 = {
+	.pdu = setup_call_421,
+	.pdu_len = sizeof(setup_call_421),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x01, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x01, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_422 = {
+	.pdu = setup_call_422,
+	.pdu_len = sizeof(setup_call_422),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2"
+};
+
+static struct setup_call_test setup_call_data_431 = {
+	.pdu = setup_call_431,
+	.pdu_len = sizeof(setup_call_431),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x02, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x02, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_432 = {
+	.pdu = setup_call_432,
+	.pdu_len = sizeof(setup_call_432),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2"
+};
+
+static struct setup_call_test setup_call_data_441 = {
+	.pdu = setup_call_441,
+	.pdu_len = sizeof(setup_call_441),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x04, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x04, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_442 = {
+	.pdu = setup_call_442,
+	.pdu_len = sizeof(setup_call_442),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_443 = {
+	.pdu = setup_call_443,
+	.pdu_len = sizeof(setup_call_443),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 3",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 3"
+};
+
+static struct setup_call_test setup_call_data_451 = {
+	.pdu = setup_call_451,
+	.pdu_len = sizeof(setup_call_451),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x08, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x08, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_452 = {
+	.pdu = setup_call_452,
+	.pdu_len = sizeof(setup_call_452),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_453 = {
+	.pdu = setup_call_453,
+	.pdu_len = sizeof(setup_call_453),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 3",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 3"
+};
+
+static struct setup_call_test setup_call_data_461 = {
+	.pdu = setup_call_461,
+	.pdu_len = sizeof(setup_call_461),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x10, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x10, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_462 = {
+	.pdu = setup_call_462,
+	.pdu_len = sizeof(setup_call_462),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_463 = {
+	.pdu = setup_call_463,
+	.pdu_len = sizeof(setup_call_463),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 3",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 3"
+};
+
+static struct setup_call_test setup_call_data_471 = {
+	.pdu = setup_call_471,
+	.pdu_len = sizeof(setup_call_471),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x20, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x20, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_472 = {
+	.pdu = setup_call_472,
+	.pdu_len = sizeof(setup_call_472),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_473 = {
+	.pdu = setup_call_473,
+	.pdu_len = sizeof(setup_call_473),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 3",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 3"
+};
+
+static struct setup_call_test setup_call_data_481 = {
+	.pdu = setup_call_481,
+	.pdu_len = sizeof(setup_call_481),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x40, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x40, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_482 = {
+	.pdu = setup_call_482,
+	.pdu_len = sizeof(setup_call_482),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_483 = {
+	.pdu = setup_call_483,
+	.pdu_len = sizeof(setup_call_483),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 3",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 3"
+};
+
+static struct setup_call_test setup_call_data_491 = {
+	.pdu = setup_call_491,
+	.pdu_len = sizeof(setup_call_491),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x80, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x80, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_492 = {
+	.pdu = setup_call_492,
+	.pdu_len = sizeof(setup_call_492),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0xB4 }
+	}
+};
+
+static struct setup_call_test setup_call_data_493 = {
+	.pdu = setup_call_493,
+	.pdu_len = sizeof(setup_call_493),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 3",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 3"
+};
+
+static struct setup_call_test setup_call_data_4101 = {
+	.pdu = setup_call_4101,
+	.pdu_len = sizeof(setup_call_4101),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 1",
+	.text_attr_usr_cfm = {
+		.len = 4,
+		.attributes = { 0x00, 0x0E, 0x00, 0xB4 }
+	},
+	.text_attr_call_setup = {
+		.len = 4,
+		.attributes = { 0x00, 0x06, 0x00, 0x4B }
+	}
+};
+
+static struct setup_call_test setup_call_data_4102 = {
+	.pdu = setup_call_4102,
+	.pdu_len = sizeof(setup_call_4102),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "CONFIRMATION 2",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456a1a2"
+	},
+	.alpha_id_call_setup = "CALL 2"
+};
+
+static struct setup_call_test setup_call_data_511 = {
+	.pdu = setup_call_511,
+	.pdu_len = sizeof(setup_call_511),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "ЗДРАВСТВУЙТЕ",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456"
+	}
+};
+
+static struct setup_call_test setup_call_data_521 = {
+	.pdu = setup_call_521,
+	.pdu_len = sizeof(setup_call_521),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "ЗДРАВСТВУЙТЕ1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456"
+	},
+	.alpha_id_call_setup = "ЗДРАВСТВУЙТЕ2"
+};
+
+static struct setup_call_test setup_call_data_611 = {
+	.pdu = setup_call_611,
+	.pdu_len = sizeof(setup_call_611),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "不忙",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456"
+	}
+};
+
+static struct setup_call_test setup_call_data_621 = {
+	.pdu = setup_call_621,
+	.pdu_len = sizeof(setup_call_621),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "确定",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456"
+	},
+	.alpha_id_call_setup = "打电话"
+};
+
+static struct setup_call_test setup_call_data_711 = {
+	.pdu = setup_call_711,
+	.pdu_len = sizeof(setup_call_711),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "ル",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456"
+	}
+};
+
+static struct setup_call_test setup_call_data_721 = {
+	.pdu = setup_call_721,
+	.pdu_len = sizeof(setup_call_721),
+	.qualifier = 0x00,
+	.alpha_id_usr_cfm = "ル1",
+	.addr = {
+		.ton_npi = 0x91,
+		.number = "012340123456"
+	},
+	.alpha_id_call_setup = "ル2"
+};
+
+static void test_setup_call(gconstpointer data)
+{
+	const struct setup_call_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_SETUP_CALL);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
+
+	check_alpha_id(command->setup_call.alpha_id_usr_cfm,
+					test->alpha_id_usr_cfm);
+	check_address(&command->setup_call.addr, &test->addr);
+	check_ccp(&command->setup_call.ccp, &test->ccp);
+	check_subaddress(&command->setup_call.subaddr, &test->subaddr);
+	check_duration(&command->setup_call.duration, &test->duration);
+	check_icon_id(&command->setup_call.icon_id_usr_cfm,
+					&test->icon_id_usr_cfm);
+	check_alpha_id(command->setup_call.alpha_id_call_setup,
+					test->alpha_id_call_setup);
+	check_icon_id(&command->setup_call.icon_id_call_setup,
+					&test->icon_id_call_setup);
+	check_text_attr(&command->setup_call.text_attr_usr_cfm,
+					&test->text_attr_usr_cfm);
+	check_text_attr(&command->setup_call.text_attr_call_setup,
+					&test->text_attr_call_setup);
+	check_frame_id(&command->setup_call.frame_id, &test->frame_id);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -8089,5 +9393,96 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Send SMS 1.1.1",
 				&send_sms_data_111, test_send_sms);
 
+	g_test_add_data_func("/teststk/Setup Call 1.1.1",
+				&setup_call_data_111, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.4.1",
+				&setup_call_data_141, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.5.1",
+				&setup_call_data_151, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.8.1",
+				&setup_call_data_181, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.9.1",
+				&setup_call_data_191, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.10.1",
+				&setup_call_data_1101, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.11.1",
+				&setup_call_data_1111, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 1.12.1",
+				&setup_call_data_1121, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 2.1.1",
+				&setup_call_data_211, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 3.1.1",
+				&setup_call_data_311, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 3.2.1",
+				&setup_call_data_321, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 3.3.1",
+				&setup_call_data_331, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 3.4.1",
+				&setup_call_data_341, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.1.1",
+				&setup_call_data_411, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.1.2",
+				&setup_call_data_412, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.2.1",
+				&setup_call_data_421, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.2.2",
+				&setup_call_data_422, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.3.1",
+				&setup_call_data_431, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.3.2",
+				&setup_call_data_432, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.4.1",
+				&setup_call_data_441, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.4.2",
+				&setup_call_data_442, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.4.3",
+				&setup_call_data_443, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.5.1",
+				&setup_call_data_451, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.5.2",
+				&setup_call_data_452, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.5.3",
+				&setup_call_data_453, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.6.1",
+				&setup_call_data_461, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.6.2",
+				&setup_call_data_462, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.6.3",
+				&setup_call_data_463, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.7.1",
+				&setup_call_data_471, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.7.2",
+				&setup_call_data_472, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.7.3",
+				&setup_call_data_473, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.8.1",
+				&setup_call_data_481, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.8.2",
+				&setup_call_data_482, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.8.3",
+				&setup_call_data_483, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.9.1",
+				&setup_call_data_491, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.9.2",
+				&setup_call_data_492, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.9.3",
+				&setup_call_data_493, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.10.1",
+				&setup_call_data_4101, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 4.10.2",
+				&setup_call_data_4102, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 5.1.1",
+				&setup_call_data_511, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 5.2.1",
+				&setup_call_data_521, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 6.1.1",
+				&setup_call_data_611, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 6.2.1",
+				&setup_call_data_621, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 7.1.1",
+				&setup_call_data_711, test_setup_call);
+	g_test_add_data_func("/teststk/Setup Call 7.2.1",
+				&setup_call_data_721, test_setup_call);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 12/27] stkutil: Add refresh proactive command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (9 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 11/27] test-stkutil: Add unit test for setup call parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 13/27] test-stkutil: Add test for refresh parser Yang Gu
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2659 bytes --]

---
 src/stkutil.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 src/stkutil.h |   10 ++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 39278e7..2227d31 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2553,6 +2553,47 @@ static gboolean parse_setup_call(struct stk_command *command,
 	return TRUE;
 }
 
+static void destroy_refresh(struct stk_command *command)
+{
+	g_slist_foreach(command->refresh.fl, (GFunc)g_free, NULL);
+	g_slist_free(command->refresh.fl);
+	g_free(command->refresh.alpha_id);
+}
+
+static gboolean parse_refresh(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_refresh *obj = &command->refresh;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_FILE_LIST, 0,
+				&obj->fl,
+				STK_DATA_OBJECT_TYPE_AID, 0,
+				&obj->aid,
+				STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+				&obj->alpha_id,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+				&obj->text_attr,
+				STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+				&obj->frame_id,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	command->destructor = destroy_refresh;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2641,6 +2682,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_SETUP_CALL:
 		ok = parse_setup_call(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_REFRESH:
+		ok = parse_refresh(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index d0d2486..d974ea1 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -874,6 +874,15 @@ struct stk_command_setup_call {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_refresh {
+	GSList *fl;
+	struct stk_aid aid;
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -891,6 +900,7 @@ struct stk_command {
 		struct stk_command_select_item select_item;
 		struct stk_command_send_sms send_sms;
 		struct stk_command_setup_call setup_call;
+		struct stk_command_refresh refresh;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 13/27] test-stkutil: Add test for refresh parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (10 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 12/27] stkutil: Add refresh proactive command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 14/27] stkutil: Add polling off proactive command parser Yang Gu
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3842 bytes --]

---
 unit/test-stkutil.c |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 75ca258..1f66631 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -194,6 +194,22 @@ static inline void check_tone(const ofono_bool_t command,
 	check_common_bool(command, test);
 }
 
+/* Defined in TS 102.223 Section 8.18 */
+static void check_file_list(GSList *command, const struct stk_file *test)
+{
+	struct stk_file *sf;
+	GSList *l;
+	unsigned int i = 0;
+
+	for (l = command; l; l = l->next) {
+		sf = l->data;
+		g_assert(sf->len == test[i].len);
+		g_assert(g_mem_equal(sf->file, test[i++].file, sf->len));
+	}
+
+	g_assert(test[i].len == 0);
+}
+
 /* Defined in TS 102.223 Section 8.23 */
 static inline void check_default_text(const char *command, const char *test)
 {
@@ -233,6 +249,13 @@ static inline void check_imm_resp(const unsigned char command,
 	check_common_byte(command, test);
 }
 
+/* Defined in TS 102.223 Section 8.60 */
+static inline void check_aid(const struct stk_aid *command,
+					const struct stk_aid *test)
+{
+	g_assert(g_mem_equal(command->aid, test->aid, test->len));
+}
+
 /* Defined in TS 102.223 Section 8.71 */
 static inline void check_cdma_sms_tpdu(
 				const struct stk_common_byte_array *command,
@@ -8858,6 +8881,69 @@ static void test_setup_call(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct refresh_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	struct stk_file fl[MAX_ITEM];
+	struct stk_aid aid;
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+static unsigned char refresh_121[] = { 0xD0, 0x10, 0x81, 0x03, 0x01, 0x01,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0x92, 0x05, 0x01, 0x3F, 0x00,
+						0x2F, 0xE2 };
+
+static unsigned char refresh_151[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x01,
+						0x04, 0x82, 0x02, 0x81, 0x82 };
+
+static struct refresh_test refresh_data_121 = {
+	.pdu = refresh_121,
+	.pdu_len = sizeof(refresh_121),
+	.qualifier = 0x01,
+	.fl[0] = {
+		.len = 4,
+		.file = { 0x3F, 0x00, 0x2F, 0xE2 }
+	}
+};
+
+static struct refresh_test refresh_data_151 = {
+	.pdu = refresh_151,
+	.pdu_len = sizeof(refresh_151),
+	.qualifier = 0x04
+};
+
+/* Defined in TS 102.384 Section 27.22.4.7 */
+static void test_refresh(gconstpointer data)
+{
+	const struct refresh_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_REFRESH);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	check_file_list(command->refresh.fl, test->fl);
+	check_aid(&command->refresh.aid, &test->aid);
+	check_alpha_id(command->refresh.alpha_id, test->alpha_id);
+	check_icon_id(&command->refresh.icon_id, &test->icon_id);
+	check_text_attr(&command->refresh.text_attr, &test->text_attr);
+	check_frame_id(&command->refresh.frame_id, &test->frame_id);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -9484,5 +9570,10 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Setup Call 7.2.1",
 				&setup_call_data_721, test_setup_call);
 
+	g_test_add_data_func("/teststk/Refresh 1.2.1",
+				&refresh_data_121, test_refresh);
+	g_test_add_data_func("/teststk/Refresh 1.5.1",
+				&refresh_data_151, test_refresh);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 14/27] stkutil: Add polling off proactive command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (11 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 13/27] test-stkutil: Add test for refresh parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 15/27] test-stkutil: Add test for polling off parser Yang Gu
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

---
 src/stkutil.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 2227d31..3aaab37 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2594,6 +2594,18 @@ static gboolean parse_refresh(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_polling_off(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2685,6 +2697,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_REFRESH:
 		ok = parse_refresh(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_POLLING_OFF:
+		ok = parse_polling_off(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 15/27] test-stkutil: Add test for polling off parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (12 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 14/27] stkutil: Add polling off proactive command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 16/27] stkutil: Add provide local info command parser Yang Gu
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]

---
 unit/test-stkutil.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 1f66631..1672202 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -8944,6 +8944,40 @@ static void test_refresh(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct polling_off_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+};
+
+static unsigned char polling_off_112[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x04,
+						0x00, 0x82, 0x02, 0x81, 0x82 };
+
+static struct polling_off_test polling_off_data_112 = {
+	.pdu = polling_off_112,
+	.pdu_len = sizeof(polling_off_112),
+	.qualifier = 0x00,
+};
+
+static void test_polling_off(gconstpointer data)
+{
+	const struct polling_off_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_POLLING_OFF);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -9575,5 +9609,8 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Refresh 1.5.1",
 				&refresh_data_151, test_refresh);
 
+	g_test_add_data_func("/teststk/Polling off 1.1.2",
+				&polling_off_data_112, test_polling_off);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 16/27] stkutil: Add provide local info command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (13 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 15/27] test-stkutil: Add test for polling off parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 17/27] test-stk: Add test for provide local info parser Yang Gu
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

---
 src/stkutil.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 3aaab37..0484687 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2606,6 +2606,18 @@ static gboolean parse_polling_off(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_provide_local_info(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2700,6 +2712,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_POLLING_OFF:
 		ok = parse_polling_off(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO:
+		ok = parse_provide_local_info(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 17/27] test-stk: Add test for provide local info parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (14 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 16/27] stkutil: Add provide local info command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 18/27] stkutil: Add event list command parser Yang Gu
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 4021 bytes --]

---
 unit/test-stkutil.c |   98 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 1672202..54e24a0 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -8978,6 +8978,91 @@ static void test_polling_off(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct provide_local_info_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+};
+
+static unsigned char provide_local_info_121[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x26, 0x01, 0x82, 0x02, 0x81,
+						0x82 };
+
+static unsigned char provide_local_info_141[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x26, 0x03, 0x82, 0x02, 0x81,
+						0x82 };
+
+static unsigned char provide_local_info_151[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x26, 0x04, 0x82, 0x02, 0x81,
+						0x82 };
+
+static unsigned char provide_local_info_181[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x26, 0x07, 0x82, 0x02, 0x81,
+						0x82 };
+
+static unsigned char provide_local_info_191[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x26, 0x08, 0x82, 0x02, 0x81,
+						0x82 };
+
+static unsigned char provide_local_info_1111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x26, 0x0A, 0x82, 0x02, 0x81,
+						0x82 };
+
+static struct provide_local_info_test provide_local_info_data_121 = {
+	.pdu = provide_local_info_121,
+	.pdu_len = sizeof(provide_local_info_121),
+	.qualifier = 0x01
+};
+
+static struct provide_local_info_test provide_local_info_data_141 = {
+	.pdu = provide_local_info_141,
+	.pdu_len = sizeof(provide_local_info_141),
+	.qualifier = 0x03
+};
+
+static struct provide_local_info_test provide_local_info_data_151 = {
+	.pdu = provide_local_info_151,
+	.pdu_len = sizeof(provide_local_info_151),
+	.qualifier = 0x04
+};
+
+static struct provide_local_info_test provide_local_info_data_181 = {
+	.pdu = provide_local_info_181,
+	.pdu_len = sizeof(provide_local_info_181),
+	.qualifier = 0x07
+};
+
+static struct provide_local_info_test provide_local_info_data_191 = {
+	.pdu = provide_local_info_191,
+	.pdu_len = sizeof(provide_local_info_191),
+	.qualifier = 0x08
+};
+
+static struct provide_local_info_test provide_local_info_data_1111 = {
+	.pdu = provide_local_info_1111,
+	.pdu_len = sizeof(provide_local_info_1111),
+	.qualifier = 0x0A
+};
+
+static void test_provide_local_info(gconstpointer data)
+{
+	const struct provide_local_info_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -9612,5 +9697,18 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Polling off 1.1.2",
 				&polling_off_data_112, test_polling_off);
 
+	g_test_add_data_func("/teststk/Provide Local Info 1.2.1",
+			&provide_local_info_data_121, test_provide_local_info);
+	g_test_add_data_func("/teststk/Provide Local Info 1.4.1",
+			&provide_local_info_data_141, test_provide_local_info);
+	g_test_add_data_func("/teststk/Provide Local Info 1.5.1",
+			&provide_local_info_data_151, test_provide_local_info);
+	g_test_add_data_func("/teststk/Provide Local Info 1.8.1",
+			&provide_local_info_data_181, test_provide_local_info);
+	g_test_add_data_func("/teststk/Provide Local Info 1.9.1",
+			&provide_local_info_data_191, test_provide_local_info);
+	g_test_add_data_func("/teststk/Provide Local Info 1.11.1",
+			&provide_local_info_data_1111, test_provide_local_info);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 18/27] stkutil: Add event list command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (15 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 17/27] test-stk: Add test for provide local info parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 19/27] test-stkutil: Add test for event list parser Yang Gu
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]

---
 src/stkutil.c |   31 ++++++++++++++++++++++++++++++-
 src/stkutil.h |    5 +++++
 2 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 0484687..01cdeef 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -703,7 +703,10 @@ static gboolean parse_dataobj_event_list(struct comprehension_tlv_iter *iter,
 	const unsigned char *data;
 	unsigned int len = comprehension_tlv_iter_get_length(iter);
 
-	if ((len < 1) || (len > sizeof(el->list)))
+	if (len == 0)
+		return TRUE;
+
+	if (len > sizeof(el->list))
 		return FALSE;
 
 	data = comprehension_tlv_iter_get_data(iter);
@@ -2618,6 +2621,29 @@ static gboolean parse_provide_local_info(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_setup_event_list(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_setup_event_list *obj = &command->setup_event_list;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_EVENT_LIST,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->event_list,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2715,6 +2741,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO:
 		ok = parse_provide_local_info(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_SETUP_EVENT_LIST:
+		ok = parse_setup_event_list(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index d974ea1..dde62e6 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -883,6 +883,10 @@ struct stk_command_refresh {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_setup_event_list {
+	struct stk_event_list event_list;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -901,6 +905,7 @@ struct stk_command {
 		struct stk_command_send_sms send_sms;
 		struct stk_command_setup_call setup_call;
 		struct stk_command_refresh refresh;
+		struct stk_command_setup_event_list setup_event_list;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 19/27] test-stkutil: Add test for event list parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (16 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 18/27] stkutil: Add event list command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 20/27] stkutil: Add perform card apdu command parser Yang Gu
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 5214 bytes --]

---
 unit/test-stkutil.c |  131 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 131 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 54e24a0..66aa091 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -225,6 +225,14 @@ static void check_items_next_action_indicator(
 	g_assert(g_mem_equal(command->list, test->list, test->len));
 }
 
+/* Defined in TS 102.223 Section 8.25 */
+static void check_event_list(const struct stk_event_list *command,
+				const struct stk_event_list *test)
+{
+	g_assert(command->len == test->len);
+	g_assert(g_mem_equal(command->list, test->list, test->len));
+}
+
 /* Defined in TS 102.223 Section 8.31 */
 static void check_icon_id(const struct stk_icon_id *command,
 					const struct stk_icon_id *test)
@@ -9063,6 +9071,116 @@ static void test_provide_local_info(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct setup_event_list_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	struct stk_event_list event_list;
+};
+
+static unsigned char setup_event_list_111[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
+						0x05, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x99, 0x01, 0x04 };
+
+static unsigned char setup_event_list_121[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01,
+						0x05, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x99, 0x02, 0x05, 0x07 };
+
+static unsigned char setup_event_list_122[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
+						0x05, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x99, 0x01, 0x07 };
+
+static unsigned char setup_event_list_131[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
+						0x05, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x99, 0x01, 0x07 };
+
+static unsigned char setup_event_list_132[] = { 0xD0, 0x0B, 0x81, 0x03, 0x01,
+						0x05, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x99, 0x00 };
+
+static unsigned char setup_event_list_141[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
+						0x05, 0x00, 0x82, 0x02, 0x81,
+						0x82, 0x99, 0x01, 0x07 };
+
+static struct setup_event_list_test setup_event_list_data_111 = {
+	.pdu = setup_event_list_111,
+	.pdu_len = sizeof(setup_event_list_111),
+	.qualifier = 0x00,
+	.event_list = {
+		.len = 1,
+		.list = { STK_EVENT_TYPE_USER_ACTIVITY }
+	}
+};
+
+static struct setup_event_list_test setup_event_list_data_121 = {
+	.pdu = setup_event_list_121,
+	.pdu_len = sizeof(setup_event_list_121),
+	.qualifier = 0x00,
+	.event_list = {
+		.len = 2,
+		.list = { STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE,
+				STK_EVENT_TYPE_LANGUAGE_SELECTION }
+	}
+};
+
+static struct setup_event_list_test setup_event_list_data_122 = {
+	.pdu = setup_event_list_122,
+	.pdu_len = sizeof(setup_event_list_122),
+	.qualifier = 0x00,
+	.event_list = {
+		.len = 1,
+		.list = { STK_EVENT_TYPE_LANGUAGE_SELECTION }
+	}
+};
+
+static struct setup_event_list_test setup_event_list_data_131 = {
+	.pdu = setup_event_list_131,
+	.pdu_len = sizeof(setup_event_list_131),
+	.qualifier = 0x00,
+	.event_list = {
+		.len = 1,
+		.list = { STK_EVENT_TYPE_LANGUAGE_SELECTION }
+	}
+};
+
+static struct setup_event_list_test setup_event_list_data_132 = {
+	.pdu = setup_event_list_132,
+	.pdu_len = sizeof(setup_event_list_132),
+	.qualifier = 0x00
+};
+
+static struct setup_event_list_test setup_event_list_data_141 = {
+	.pdu = setup_event_list_141,
+	.pdu_len = sizeof(setup_event_list_141),
+	.qualifier = 0x00,
+	.event_list = {
+		.len = 1,
+		.list = { STK_EVENT_TYPE_LANGUAGE_SELECTION }
+	}
+};
+
+static void test_setup_event_list(gconstpointer data)
+{
+	const struct setup_event_list_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_SETUP_EVENT_LIST);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	check_event_list(&command->setup_event_list.event_list,
+						&test->event_list);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -9710,5 +9828,18 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Provide Local Info 1.11.1",
 			&provide_local_info_data_1111, test_provide_local_info);
 
+	g_test_add_data_func("/teststk/Setup Event List 1.1.1",
+			&setup_event_list_data_111, test_setup_event_list);
+	g_test_add_data_func("/teststk/Setup Event List 1.2.1",
+			&setup_event_list_data_121, test_setup_event_list);
+	g_test_add_data_func("/teststk/Setup Event List 1.2.2",
+			&setup_event_list_data_122, test_setup_event_list);
+	g_test_add_data_func("/teststk/Setup Event List 1.3.1",
+			&setup_event_list_data_131, test_setup_event_list);
+	g_test_add_data_func("/teststk/Setup Event List 1.3.2",
+			&setup_event_list_data_132, test_setup_event_list);
+	g_test_add_data_func("/teststk/Setup Event List 1.4.1",
+			&setup_event_list_data_141, test_setup_event_list);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 20/27] stkutil: Add perform card apdu command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (17 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 19/27] test-stkutil: Add test for event list parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 21/27] test-stk: Add test for perform card apdu parser Yang Gu
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 5266 bytes --]

---
 src/stkutil.c |   27 ++++++++++++++++++++++
 src/stkutil.h |   69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 01cdeef..8ba4b2d 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2644,6 +2644,30 @@ static gboolean parse_setup_event_list(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_perform_card_apdu(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_perform_card_apdu *obj = &command->perform_card_apdu;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CARD_READER_0) ||
+			(command->dst > STK_DEVICE_IDENTITY_TYPE_CARD_READER_7))
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_C_APDU,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->c_apdu,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2744,6 +2768,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_SETUP_EVENT_LIST:
 		ok = parse_setup_event_list(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_PERFORM_CARD_APDU:
+		ok = parse_perform_card_apdu(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index dde62e6..809cb8c 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -183,6 +183,16 @@ enum stk_device_identity_type {
 	STK_DEVICE_IDENTITY_TYPE_KEYPAD =	0x01,
 	STK_DEVICE_IDENTITY_TYPE_DISPLAY =	0x02,
 	STK_DEVICE_IDENTITY_TYPE_EARPIECE =	0x03,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_0 = 0x10,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_1 = 0x11,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_2 = 0x12,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_3 = 0x13,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_4 = 0x14,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_5 = 0x15,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_6 = 0x16,
+	STK_DEVICE_IDENTITY_TYPE_CARD_READER_7 = 0x17,
+	STK_DEVICE_IDENTITY_TYPE_CHANNEL_1 = 0x21,
+	STK_DEVICE_IDENTITY_TYPE_CHANNEL_7 = 0x27,
 	STK_DEVICE_IDENTITY_TYPE_UICC =		0x81,
 	STK_DEVICE_IDENTITY_TYPE_TERMINAL =	0x82,
 	STK_DEVICE_IDENTITY_TYPE_NETWORK =	0x83,
@@ -301,6 +311,60 @@ enum stk_icon_qualifier {
 	STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY =	0x01
 };
 
+enum stk_ins {
+	STK_INS_DEACTIVATE_FILE = 			0X04,
+	STK_INS_ERASE_RECORDS = 			0X0C,
+	STK_INS_ERASE_BINARY_0E = 			0X0E,
+	STK_INS_ERASE_BINARY_0F = 			0X0F,
+	STK_INS_PERFORM_SCQL_OPERATION = 		0X10,
+	STK_INS_PERFORM_TRANSACTION_OPERATION = 	0X12,
+	STK_INS_PERFORM_USER_OPEPRATION = 		0X14,
+	STK_INS_VERIFY_20 = 				0X20,
+	STK_INS_VERIFY_21 = 				0X21,
+	STK_INS_MANAGE_SECURITY_ENVIRONMENT = 		0X22,
+	STK_INS_CHANGE_REFERENCE_DATA = 		0X24,
+	STK_INS_DISABLE_VERIFICATION_REQUIREMENT = 	0X26,
+	STK_INS_ENABLE_VERIFICATION_REQUIREMENT = 	0X28,
+	STK_INS_PERFORM_SECURITY_OPERATION = 		0X2A,
+	STK_INS_RESET_RETRY_COUNTER = 			0X2C,
+	STK_INS_ACTIVATE_FILE = 			0X44,
+	STK_INS_GENERATE_ASYMMETRIC_KEY_PAIR = 		0X46,
+	STK_INS_MANAGE_CHANNEL = 			0X70,
+	STK_INS_EXTERNAL_AUTHENTICATE = 		0X82,
+	STK_INS_GET_CHALLENGE = 			0X84,
+	STK_INS_GENERAL_AUTHENTICATE_86 = 		0X86,
+	STK_INS_GENERAL_AUTHENTICATE_87 = 		0X87,
+	STK_INS_INTERNAL_AUTHENTICATE = 		0X88,
+	STK_INS_SEARCH_BINARY_A0 = 			0XA0,
+	STK_INS_SEARCH_BINARY_A1 = 			0XA1,
+	STK_INS_SEARCH_RECORD = 			0XA2,
+	STK_INS_SELECT = 				0XA4,
+	STK_INS_READ_BINARY_B0 = 			0XB0,
+	STK_INS_READ_BINARY_B1 = 			0XB1,
+	STK_INS_READ_RECORDS_B2 = 			0XB2,
+	STK_INS_READ_RECORDS_B3 = 			0XB3,
+	STK_INS_GET_RESPONSE = 				0XC0,
+	STK_INS_ENVELOPE_C2 = 				0XC2,
+	STK_INS_ENVELOPE_C3 =				0XC3,
+	STK_INS_GET_DATA_CA =				0XCA,
+	STK_INS_GET_DATA_CB =				0XCB,
+	STK_INS_WRITE_BINARY_D0 =			0XD0,
+	STK_INS_WRITE_BINARY_D1 = 			0XD1,
+	STK_INS_WRITE_RECORD = 				0XD2,
+	STK_INS_UPDATE_BINARY_D6 = 			0XD6,
+	STK_INS_UPDATE_BINARY_D7 = 			0XD7,
+	STK_INS_PUT_DATA_DA = 				0XDA,
+	STK_INS_PUT_DATA_DB = 				0XDB,
+	STK_INS_UPDATE_RECORD_DC = 			0XDC,
+	STK_INS_UPDATE_RECORD_DD = 			0XDD,
+	STK_INS_CREATE_FILE = 				0XE0,
+	STK_INS_APPEND_RECORD = 			0XE2,
+	STK_INS_DELETE_FILE = 				0XE4,
+	STK_INS_TERMINATE_DF = 				0XE6,
+	STK_INS_TERMINATE_EF = 				0XE8,
+	STK_INS_TERMINATE_CARD_USAGE = 			0XFE
+};
+
 enum stk_browser_id {
 	STK_BROWSER_ID_DEFAULT =	0x00,
 	STK_BROWSER_ID_WML =		0x01,
@@ -887,6 +951,10 @@ struct stk_command_setup_event_list {
 	struct stk_event_list event_list;
 };
 
+struct stk_command_perform_card_apdu {
+	struct stk_c_apdu c_apdu;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -906,6 +974,7 @@ struct stk_command {
 		struct stk_command_setup_call setup_call;
 		struct stk_command_refresh refresh;
 		struct stk_command_setup_event_list setup_event_list;
+		struct stk_command_perform_card_apdu perform_card_apdu;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 21/27] test-stk: Add test for perform card apdu parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (18 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 20/27] stkutil: Add perform card apdu command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 22/27] stkutil: Add power off card command parser Yang Gu
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 9303 bytes --]

---
 unit/test-stkutil.c |  259 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 259 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 66aa091..340f15f 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -45,6 +45,7 @@ static gboolean g_mem_equal(const unsigned char *v1, const unsigned char *v2,
 	for (i = 0; i < len; i++)
 		if (v1[i] != v2[i])
 			return FALSE;
+
 	return TRUE;
 }
 
@@ -250,6 +251,21 @@ static void check_item_icon_id_list(const struct stk_item_icon_id_list *command,
 	g_assert(g_mem_equal(command->list, test->list, test->len));
 }
 
+/* Defined in TS 102.223 Section 8.35 */
+static void check_c_apdu(const struct stk_c_apdu *command,
+				const struct stk_c_apdu *test)
+{
+	g_assert(command->cla == test->cla);
+	g_assert(command->ins == test->ins);
+	g_assert(command->p1 == test->p1);
+	g_assert(command->p2 == test->p2);
+	g_assert(command->lc == test->lc);
+	g_assert(g_mem_equal(command->data, test->data, test->lc));
+
+	if (test->has_le)
+		g_assert(command->le == test->le);
+}
+
 /* Defined in TS 102.223 Section 8.43 */
 static inline void check_imm_resp(const unsigned char command,
 					const unsigned char test)
@@ -9181,6 +9197,230 @@ static void test_setup_event_list(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct perform_card_apdu_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	unsigned char dst;
+	struct stk_c_apdu c_apdu;
+};
+
+static unsigned char perform_card_apdu_111[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x07, 0xA0, 0xA4,
+						0x00, 0x00, 0x02, 0x3F, 0x00 };
+
+static unsigned char perform_card_apdu_112[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x05, 0xA0, 0xC0,
+						0x00, 0x00, 0x1B };
+
+static unsigned char perform_card_apdu_121[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x07, 0xA0, 0xA4,
+						0x00, 0x00, 0x02, 0x7F, 0x20 };
+
+static unsigned char perform_card_apdu_122[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x07, 0xA0, 0xA4,
+						0x00, 0x00, 0x02, 0x6F, 0x30 };
+
+static unsigned char perform_card_apdu_123[] = { 0xD0, 0x28, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x1D, 0xA0, 0xD6,
+						0x00, 0x00, 0x18, 0x00, 0x01,
+						0x02, 0x03, 0x04, 0x05, 0x06,
+						0x07, 0x08, 0x09, 0x0A, 0x0B,
+						0x0C, 0x0D, 0x0E, 0x0F, 0x10,
+						0x11, 0x12, 0x13, 0x14, 0x15,
+						0x16, 0x17 };
+
+static unsigned char perform_card_apdu_124[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x05, 0xA0, 0xB0,
+						0x00, 0x00, 0x18 };
+
+static unsigned char perform_card_apdu_125[] = { 0xD0, 0x28, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x1D, 0xA0, 0xD6,
+						0x00, 0x00, 0x18, 0xFF, 0xFF,
+						0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+						0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+						0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+						0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+						0xFF, 0xFF };
+
+static unsigned char perform_card_apdu_151[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x17, 0xA2, 0x07, 0xA0, 0xA4,
+						0x00, 0x00, 0x02, 0x3F, 0x00 };
+
+static unsigned char perform_card_apdu_211[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+						0x30, 0x00, 0x82, 0x02, 0x81,
+						0x11, 0xA2, 0x07, 0xA0, 0xA4,
+						0x00, 0x00, 0x02, 0x3F, 0x00 };
+
+static struct perform_card_apdu_test perform_card_apdu_data_111 = {
+	.pdu = perform_card_apdu_111,
+	.pdu_len = sizeof(perform_card_apdu_111),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_SELECT,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x02,
+		.data = { 0x3F, 0x00 }
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_112 = {
+	.pdu = perform_card_apdu_112,
+	.pdu_len = sizeof(perform_card_apdu_112),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_GET_RESPONSE,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.has_le = 1,
+		.le = 0x1B
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_121 = {
+	.pdu = perform_card_apdu_121,
+	.pdu_len = sizeof(perform_card_apdu_121),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_SELECT,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x02,
+		.data = { 0x7F, 0x20 }
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_122 = {
+	.pdu = perform_card_apdu_122,
+	.pdu_len = sizeof(perform_card_apdu_122),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_SELECT,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x02,
+		.data = { 0x6F, 0x30 }
+	}
+};
+
+/* Byte 14 of Data is not correct in spec. */
+static struct perform_card_apdu_test perform_card_apdu_data_123 = {
+	.pdu = perform_card_apdu_123,
+	.pdu_len = sizeof(perform_card_apdu_123),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_UPDATE_BINARY_D6,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x18,
+		.data = { 0x00, 0x01, 0x02, 0x03, 0x04,	0x05, 0x06, 0x07, 0x08,
+				0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
+				0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_124 = {
+	.pdu = perform_card_apdu_124,
+	.pdu_len = sizeof(perform_card_apdu_124),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_READ_BINARY_B0,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.has_le = 1,
+		.le = 0x18
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_125 = {
+	.pdu = perform_card_apdu_125,
+	.pdu_len = sizeof(perform_card_apdu_125),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_UPDATE_BINARY_D6,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x18,
+		.data = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+				0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_151 = {
+	.pdu = perform_card_apdu_151,
+	.pdu_len = sizeof(perform_card_apdu_151),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_7,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_SELECT,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x02,
+		.data = { 0x3F, 0x00 }
+	}
+};
+
+static struct perform_card_apdu_test perform_card_apdu_data_211 = {
+	.pdu = perform_card_apdu_211,
+	.pdu_len = sizeof(perform_card_apdu_211),
+	.qualifier = 0x00,
+	.dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
+	.c_apdu = {
+		.cla = 0xA0,
+		.ins = STK_INS_SELECT,
+		.p1 = 0x00,
+		.p2 = 0x00,
+		.lc = 0x02,
+		.data = { 0x3F, 0x00 }
+	}
+};
+
+static void test_perform_card_apdu(gconstpointer data)
+{
+	const struct perform_card_apdu_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_PERFORM_CARD_APDU);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == test->dst);
+
+	check_c_apdu(&command->perform_card_apdu.c_apdu, &test->c_apdu);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -9841,5 +10081,24 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Setup Event List 1.4.1",
 			&setup_event_list_data_141, test_setup_event_list);
 
+	g_test_add_data_func("/teststk/Perform Card APDU 1.1.1",
+			&perform_card_apdu_data_111, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.1.2",
+			&perform_card_apdu_data_112, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.2.1",
+			&perform_card_apdu_data_121, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.2.2",
+			&perform_card_apdu_data_122, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.2.3",
+			&perform_card_apdu_data_123, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.2.4",
+			&perform_card_apdu_data_124, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.2.5",
+			&perform_card_apdu_data_125, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 1.5.1",
+			&perform_card_apdu_data_151, test_perform_card_apdu);
+	g_test_add_data_func("/teststk/Perform Card APDU 2.1.1",
+			&perform_card_apdu_data_211, test_perform_card_apdu);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 22/27] stkutil: Add power off card command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (19 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 21/27] test-stk: Add test for perform card apdu parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 23/27] stkutil: Add power on " Yang Gu
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

---
 src/stkutil.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 8ba4b2d..8d7ca9b 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2668,6 +2668,19 @@ static gboolean parse_perform_card_apdu(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_power_off_card(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CARD_READER_0) ||
+			(command->dst > STK_DEVICE_IDENTITY_TYPE_CARD_READER_7))
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2771,6 +2784,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_PERFORM_CARD_APDU:
 		ok = parse_perform_card_apdu(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_POWER_OFF_CARD:
+		ok = parse_power_off_card(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 23/27] stkutil: Add power on card command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (20 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 22/27] stkutil: Add power off card command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 24/27] stkutil: Add get reader status " Yang Gu
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

---
 src/stkutil.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 8d7ca9b..ae074d8 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2681,6 +2681,19 @@ static gboolean parse_power_off_card(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_power_on_card(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CARD_READER_0) ||
+			(command->dst > STK_DEVICE_IDENTITY_TYPE_CARD_READER_7))
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2787,6 +2800,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_POWER_OFF_CARD:
 		ok = parse_power_off_card(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_POWER_ON_CARD:
+		ok = parse_power_on_card(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 24/27] stkutil: Add get reader status command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (21 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 23/27] stkutil: Add power on " Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 25/27] test-stk: Add test for get reader status parser Yang Gu
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

---
 src/stkutil.c |   27 +++++++++++++++++++++++++++
 src/stkutil.h |    5 +++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index ae074d8..608a679 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2694,6 +2694,30 @@ static gboolean parse_power_on_card(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_get_reader_status(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	switch (command->qualifier) {
+	case STK_QUALIFIER_TYPE_CARD_READER_STATUS:
+		if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+			return FALSE;
+		break;
+	case STK_QUALIFIER_TYPE_CARD_READER_ID:
+		if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CARD_READER_0) ||
+				(command->dst >
+					STK_DEVICE_IDENTITY_TYPE_CARD_READER_7))
+			return FALSE;
+		break;
+	default:
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2803,6 +2827,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_POWER_ON_CARD:
 		ok = parse_power_on_card(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_GET_READER_STATUS:
+		ok = parse_get_reader_status(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 809cb8c..5da7cc6 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -198,6 +198,11 @@ enum stk_device_identity_type {
 	STK_DEVICE_IDENTITY_TYPE_NETWORK =	0x83,
 };
 
+enum stk_qualifier_get_reader_status_type {
+	STK_QUALIFIER_TYPE_CARD_READER_STATUS = 	0x00,
+	STK_QUALIFIER_TYPE_CARD_READER_ID = 		0x01,
+};
+
 enum stk_duration_type {
 	STK_DURATION_TYPE_MINUTES =		0x00,
 	STK_DURATION_TYPE_SECONDS =		0x01,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 25/27] test-stk: Add test for get reader status parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (22 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 24/27] stkutil: Add get reader status " Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 26/27] stkutil: Add timer management command parser Yang Gu
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

---
 unit/test-stkutil.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 340f15f..5a6d2a4 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -9421,6 +9421,48 @@ static void test_perform_card_apdu(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct get_reader_status_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+};
+
+static unsigned char get_reader_status_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
+						0x33, 0x00, 0x82, 0x02, 0x81,
+						0x82 };
+
+static struct get_reader_status_test get_reader_status_data_111 = {
+	.pdu = get_reader_status_111,
+	.pdu_len = sizeof(get_reader_status_111),
+	.qualifier = STK_QUALIFIER_TYPE_CARD_READER_STATUS,
+};
+
+static void test_get_reader_status(gconstpointer data)
+{
+	const struct get_reader_status_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_GET_READER_STATUS);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+
+	if (command->qualifier == STK_QUALIFIER_TYPE_CARD_READER_STATUS)
+		g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+	else
+		g_assert(command->dst <
+				STK_DEVICE_IDENTITY_TYPE_CARD_READER_0 ||
+			command->dst >
+				STK_DEVICE_IDENTITY_TYPE_CARD_READER_7);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -10100,5 +10142,8 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Perform Card APDU 2.1.1",
 			&perform_card_apdu_data_211, test_perform_card_apdu);
 
+	g_test_add_data_func("/teststk/Get Reader Status 1.1.1",
+			&get_reader_status_data_111, test_get_reader_status);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 26/27] stkutil: Add timer management command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (23 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 25/27] test-stk: Add test for get reader status parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 10:48 ` [PATCH 27/27] test-stk: Add test for timer management parser Yang Gu
  2010-05-13 20:37 ` [PATCH 01/27] stk: Add poll interval proactive command parser Denis Kenzior
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

---
 src/stkutil.c |   28 ++++++++++++++++++++++++++++
 src/stkutil.h |    6 ++++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 608a679..9cfc6e2 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2718,6 +2718,31 @@ static gboolean parse_get_reader_status(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_timer_mgmt(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_timer_mgmt *obj = &command->timer_mgmt;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_TIMER_ID,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->timer_id,
+				STK_DATA_OBJECT_TYPE_TIMER_VALUE, 0,
+				&obj->timer_value,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2830,6 +2855,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_GET_READER_STATUS:
 		ok = parse_get_reader_status(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_TIMER_MANAGEMENT:
+		ok = parse_timer_mgmt(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 5da7cc6..80af488 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -960,6 +960,11 @@ struct stk_command_perform_card_apdu {
 	struct stk_c_apdu c_apdu;
 };
 
+struct stk_command_timer_mgmt {
+	unsigned char timer_id;
+	struct stk_timer_value timer_value;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -980,6 +985,7 @@ struct stk_command {
 		struct stk_command_refresh refresh;
 		struct stk_command_setup_event_list setup_event_list;
 		struct stk_command_perform_card_apdu perform_card_apdu;
+		struct stk_command_timer_mgmt timer_mgmt;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 27/27] test-stk: Add test for timer management parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (24 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 26/27] stkutil: Add timer management command parser Yang Gu
@ 2010-05-13 10:48 ` Yang Gu
  2010-05-13 20:37 ` [PATCH 01/27] stk: Add poll interval proactive command parser Denis Kenzior
  26 siblings, 0 replies; 29+ messages in thread
From: Yang Gu @ 2010-05-13 10:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 19652 bytes --]

---
 unit/test-stkutil.c |  609 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 609 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 5a6d2a4..8642680 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -266,6 +266,22 @@ static void check_c_apdu(const struct stk_c_apdu *command,
 		g_assert(command->le == test->le);
 }
 
+/* Defined in TS 102.223 Section 8.37 */
+static inline void check_timer_id(const unsigned char command,
+					const unsigned char test)
+{
+	check_common_byte(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.38 */
+static inline void check_timer_value(const struct stk_timer_value *command,
+					const struct stk_timer_value *test)
+{
+	g_assert(command->hour == test->hour);
+	g_assert(command->minute == test->minute);
+	g_assert(command->second == test->second);
+}
+
 /* Defined in TS 102.223 Section 8.43 */
 static inline void check_imm_resp(const unsigned char command,
 					const unsigned char test)
@@ -9463,6 +9479,522 @@ static void test_get_reader_status(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct timer_mgmt_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	unsigned char timer_id;
+	struct stk_timer_value timer_value;
+};
+
+static unsigned char timer_mgmt_111[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01, 0xA5, 0x03,
+						0x00, 0x50, 0x00 };
+
+static unsigned char timer_mgmt_112[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01 };
+
+static unsigned char timer_mgmt_113[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01, 0xA5, 0x03,
+						0x00, 0x10, 0x03 };
+
+static unsigned char timer_mgmt_114[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01 };
+
+static unsigned char timer_mgmt_121[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02, 0xA5, 0x03,
+						0x32, 0x95, 0x95 };
+
+static unsigned char timer_mgmt_122[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02 };
+
+static unsigned char timer_mgmt_123[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02, 0xA5, 0x03,
+						0x00, 0x10, 0x01 };
+
+static unsigned char timer_mgmt_124[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02 };
+
+static unsigned char timer_mgmt_131[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08, 0xA5, 0x03,
+						0x00, 0x02, 0x00 };
+
+static unsigned char timer_mgmt_132[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08 };
+
+static unsigned char timer_mgmt_133[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08, 0xA5, 0x03,
+						0x10, 0x00, 0x00 };
+
+static unsigned char timer_mgmt_134[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08 };
+
+static unsigned char timer_mgmt_141[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01 };
+
+static unsigned char timer_mgmt_142[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02 };
+
+static unsigned char timer_mgmt_143[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x03 };
+
+static unsigned char timer_mgmt_144[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x04 };
+
+static unsigned char timer_mgmt_145[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x05 };
+
+static unsigned char timer_mgmt_146[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x06 };
+
+static unsigned char timer_mgmt_147[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x07 };
+
+static unsigned char timer_mgmt_148[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x02, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08 };
+
+static unsigned char timer_mgmt_151[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01 };
+
+static unsigned char timer_mgmt_152[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02 };
+
+static unsigned char timer_mgmt_153[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x03 };
+
+static unsigned char timer_mgmt_154[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x04 };
+
+static unsigned char timer_mgmt_155[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x05 };
+
+static unsigned char timer_mgmt_156[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x06 };
+
+static unsigned char timer_mgmt_157[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x07 };
+
+static unsigned char timer_mgmt_158[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
+						0x01, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08 };
+
+static unsigned char timer_mgmt_161[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_162[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x02, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_163[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x03, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_164[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x04, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_165[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x05, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_166[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x06, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_167[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x07, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_168[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x08, 0xA5, 0x03,
+						0x00, 0x00, 0x50 };
+
+static unsigned char timer_mgmt_211[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01, 0xA5, 0x03,
+						0x00, 0x00, 0x01 };
+
+static unsigned char timer_mgmt_221[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
+						0x00, 0x82, 0x02, 0x81, 0x82,
+						0xA4, 0x01, 0x01, 0xA5, 0x03,
+						0x00, 0x00, 0x03 };
+
+static struct timer_mgmt_test timer_mgmt_data_111 = {
+	.pdu = timer_mgmt_111,
+	.pdu_len = sizeof(timer_mgmt_111),
+	.qualifier = 0x00,
+	.timer_id = 1,
+	.timer_value = {
+		.minute = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_112 = {
+	.pdu = timer_mgmt_112,
+	.pdu_len = sizeof(timer_mgmt_112),
+	.qualifier = 0x02,
+	.timer_id = 1
+};
+
+static struct timer_mgmt_test timer_mgmt_data_113 = {
+	.pdu = timer_mgmt_113,
+	.pdu_len = sizeof(timer_mgmt_113),
+	.qualifier = 0x00,
+	.timer_id = 1,
+	.timer_value = {
+		.minute = 1,
+		.second = 30
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_114 = {
+	.pdu = timer_mgmt_114,
+	.pdu_len = sizeof(timer_mgmt_114),
+	.qualifier = 0x01,
+	.timer_id = 1
+};
+
+static struct timer_mgmt_test timer_mgmt_data_121 = {
+	.pdu = timer_mgmt_121,
+	.pdu_len = sizeof(timer_mgmt_121),
+	.qualifier = 0x00,
+	.timer_id = 2,
+	.timer_value = {
+		.hour = 23,
+		.minute = 59,
+		.second = 59
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_122 = {
+	.pdu = timer_mgmt_122,
+	.pdu_len = sizeof(timer_mgmt_122),
+	.qualifier = 0x02,
+	.timer_id = 2
+};
+
+static struct timer_mgmt_test timer_mgmt_data_123 = {
+	.pdu = timer_mgmt_123,
+	.pdu_len = sizeof(timer_mgmt_123),
+	.qualifier = 0x00,
+	.timer_id = 2,
+	.timer_value = {
+		.minute = 1,
+		.second = 10
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_124 = {
+	.pdu = timer_mgmt_124,
+	.pdu_len = sizeof(timer_mgmt_124),
+	.qualifier = 0x01,
+	.timer_id = 2
+};
+
+static struct timer_mgmt_test timer_mgmt_data_131 = {
+	.pdu = timer_mgmt_131,
+	.pdu_len = sizeof(timer_mgmt_131),
+	.qualifier = 0x00,
+	.timer_id = 8,
+	.timer_value = {
+		.minute = 20
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_132 = {
+	.pdu = timer_mgmt_132,
+	.pdu_len = sizeof(timer_mgmt_132),
+	.qualifier = 0x02,
+	.timer_id = 8
+};
+
+static struct timer_mgmt_test timer_mgmt_data_133 = {
+	.pdu = timer_mgmt_133,
+	.pdu_len = sizeof(timer_mgmt_133),
+	.qualifier = 0x00,
+	.timer_id = 8,
+	.timer_value = {
+		.hour = 1
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_134 = {
+	.pdu = timer_mgmt_134,
+	.pdu_len = sizeof(timer_mgmt_134),
+	.qualifier = 0x01,
+	.timer_id = 8
+};
+
+static struct timer_mgmt_test timer_mgmt_data_141 = {
+	.pdu = timer_mgmt_141,
+	.pdu_len = sizeof(timer_mgmt_141),
+	.qualifier = 0x02,
+	.timer_id = 1
+};
+
+static struct timer_mgmt_test timer_mgmt_data_142 = {
+	.pdu = timer_mgmt_142,
+	.pdu_len = sizeof(timer_mgmt_142),
+	.qualifier = 0x02,
+	.timer_id = 2
+};
+
+static struct timer_mgmt_test timer_mgmt_data_143 = {
+	.pdu = timer_mgmt_143,
+	.pdu_len = sizeof(timer_mgmt_143),
+	.qualifier = 0x02,
+	.timer_id = 3
+};
+
+static struct timer_mgmt_test timer_mgmt_data_144 = {
+	.pdu = timer_mgmt_144,
+	.pdu_len = sizeof(timer_mgmt_144),
+	.qualifier = 0x02,
+	.timer_id = 4
+};
+
+static struct timer_mgmt_test timer_mgmt_data_145 = {
+	.pdu = timer_mgmt_145,
+	.pdu_len = sizeof(timer_mgmt_145),
+	.qualifier = 0x02,
+	.timer_id = 5
+};
+
+static struct timer_mgmt_test timer_mgmt_data_146 = {
+	.pdu = timer_mgmt_146,
+	.pdu_len = sizeof(timer_mgmt_146),
+	.qualifier = 0x02,
+	.timer_id = 6
+};
+
+static struct timer_mgmt_test timer_mgmt_data_147 = {
+	.pdu = timer_mgmt_147,
+	.pdu_len = sizeof(timer_mgmt_147),
+	.qualifier = 0x02,
+	.timer_id = 7
+};
+
+static struct timer_mgmt_test timer_mgmt_data_148 = {
+	.pdu = timer_mgmt_148,
+	.pdu_len = sizeof(timer_mgmt_148),
+	.qualifier = 0x02,
+	.timer_id = 8
+};
+
+static struct timer_mgmt_test timer_mgmt_data_151 = {
+	.pdu = timer_mgmt_151,
+	.pdu_len = sizeof(timer_mgmt_151),
+	.qualifier = 0x01,
+	.timer_id = 1
+};
+
+static struct timer_mgmt_test timer_mgmt_data_152 = {
+	.pdu = timer_mgmt_152,
+	.pdu_len = sizeof(timer_mgmt_152),
+	.qualifier = 0x01,
+	.timer_id = 2
+};
+
+static struct timer_mgmt_test timer_mgmt_data_153 = {
+	.pdu = timer_mgmt_153,
+	.pdu_len = sizeof(timer_mgmt_153),
+	.qualifier = 0x01,
+	.timer_id = 3
+};
+
+static struct timer_mgmt_test timer_mgmt_data_154 = {
+	.pdu = timer_mgmt_154,
+	.pdu_len = sizeof(timer_mgmt_154),
+	.qualifier = 0x01,
+	.timer_id = 4
+};
+
+static struct timer_mgmt_test timer_mgmt_data_155 = {
+	.pdu = timer_mgmt_155,
+	.pdu_len = sizeof(timer_mgmt_155),
+	.qualifier = 0x01,
+	.timer_id = 5
+};
+
+static struct timer_mgmt_test timer_mgmt_data_156 = {
+	.pdu = timer_mgmt_156,
+	.pdu_len = sizeof(timer_mgmt_156),
+	.qualifier = 0x01,
+	.timer_id = 6
+};
+
+static struct timer_mgmt_test timer_mgmt_data_157 = {
+	.pdu = timer_mgmt_157,
+	.pdu_len = sizeof(timer_mgmt_157),
+	.qualifier = 0x01,
+	.timer_id = 7
+};
+
+static struct timer_mgmt_test timer_mgmt_data_158 = {
+	.pdu = timer_mgmt_158,
+	.pdu_len = sizeof(timer_mgmt_158),
+	.qualifier = 0x01,
+	.timer_id = 8
+};
+
+static struct timer_mgmt_test timer_mgmt_data_161 = {
+	.pdu = timer_mgmt_161,
+	.pdu_len = sizeof(timer_mgmt_161),
+	.qualifier = 0x00,
+	.timer_id = 1,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_162 = {
+	.pdu = timer_mgmt_162,
+	.pdu_len = sizeof(timer_mgmt_162),
+	.qualifier = 0x00,
+	.timer_id = 2,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_163 = {
+	.pdu = timer_mgmt_163,
+	.pdu_len = sizeof(timer_mgmt_163),
+	.qualifier = 0x00,
+	.timer_id = 3,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_164 = {
+	.pdu = timer_mgmt_164,
+	.pdu_len = sizeof(timer_mgmt_164),
+	.qualifier = 0x00,
+	.timer_id = 4,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_165 = {
+	.pdu = timer_mgmt_165,
+	.pdu_len = sizeof(timer_mgmt_165),
+	.qualifier = 0x00,
+	.timer_id = 5,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_166 = {
+	.pdu = timer_mgmt_166,
+	.pdu_len = sizeof(timer_mgmt_166),
+	.qualifier = 0x00,
+	.timer_id = 6,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_167 = {
+	.pdu = timer_mgmt_167,
+	.pdu_len = sizeof(timer_mgmt_167),
+	.qualifier = 0x00,
+	.timer_id = 7,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_168 = {
+	.pdu = timer_mgmt_168,
+	.pdu_len = sizeof(timer_mgmt_168),
+	.qualifier = 0x00,
+	.timer_id = 8,
+	.timer_value = {
+		.second = 5
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_211 = {
+	.pdu = timer_mgmt_211,
+	.pdu_len = sizeof(timer_mgmt_211),
+	.qualifier = 0x00,
+	.timer_id = 1,
+	.timer_value = {
+		.second = 10
+	}
+};
+
+static struct timer_mgmt_test timer_mgmt_data_221 = {
+	.pdu = timer_mgmt_221,
+	.pdu_len = sizeof(timer_mgmt_221),
+	.qualifier = 0x00,
+	.timer_id = 1,
+	.timer_value = {
+		.second = 30
+	}
+};
+
+static void test_timer_mgmt(gconstpointer data)
+{
+	const struct timer_mgmt_test *test = data;
+	struct stk_command *command;
+
+	command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+	g_assert(command);
+
+	g_assert(command->number == 1);
+	g_assert(command->type == STK_COMMAND_TYPE_TIMER_MANAGEMENT);
+	g_assert(command->qualifier == test->qualifier);
+
+	g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+	check_timer_id(command->timer_mgmt.timer_id, test->timer_id);
+	check_timer_value(&command->timer_mgmt.timer_value, &test->timer_value);
+
+	stk_command_free(command);
+}
+
 int main(int argc, char **argv)
 {
 	g_test_init(&argc, &argv, NULL);
@@ -10145,5 +10677,82 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Get Reader Status 1.1.1",
 			&get_reader_status_data_111, test_get_reader_status);
 
+	g_test_add_data_func("/teststk/Timer Management 1.1.1",
+			&timer_mgmt_data_111, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.1.2",
+			&timer_mgmt_data_112, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.1.3",
+			&timer_mgmt_data_113, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.1.4",
+			&timer_mgmt_data_114, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.2.1",
+			&timer_mgmt_data_121, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.2.2",
+			&timer_mgmt_data_122, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.2.3",
+			&timer_mgmt_data_123, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.2.4",
+			&timer_mgmt_data_124, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.3.1",
+			&timer_mgmt_data_131, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.3.2",
+			&timer_mgmt_data_132, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.3.3",
+			&timer_mgmt_data_133, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.3.4",
+			&timer_mgmt_data_134, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.1",
+			&timer_mgmt_data_141, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.2",
+			&timer_mgmt_data_142, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.3",
+			&timer_mgmt_data_143, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.4",
+			&timer_mgmt_data_144, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.5",
+			&timer_mgmt_data_145, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.6",
+			&timer_mgmt_data_146, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.7",
+			&timer_mgmt_data_147, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.4.8",
+			&timer_mgmt_data_148, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.1",
+			&timer_mgmt_data_151, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.2",
+			&timer_mgmt_data_152, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.3",
+			&timer_mgmt_data_153, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.4",
+			&timer_mgmt_data_154, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.5",
+			&timer_mgmt_data_155, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.6",
+			&timer_mgmt_data_156, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.7",
+			&timer_mgmt_data_157, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.5.8",
+			&timer_mgmt_data_158, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.1",
+			&timer_mgmt_data_161, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.2",
+			&timer_mgmt_data_162, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.3",
+			&timer_mgmt_data_163, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.4",
+			&timer_mgmt_data_164, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.5",
+			&timer_mgmt_data_165, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.6",
+			&timer_mgmt_data_166, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.7",
+			&timer_mgmt_data_167, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 1.6.8",
+			&timer_mgmt_data_168, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 2.1.1",
+			&timer_mgmt_data_211, test_timer_mgmt);
+	g_test_add_data_func("/teststk/Timer Management 2.2.1",
+			&timer_mgmt_data_221, test_timer_mgmt);
+
 	return g_test_run();
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 01/27] stk: Add poll interval proactive command parser
  2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
                   ` (25 preceding siblings ...)
  2010-05-13 10:48 ` [PATCH 27/27] test-stk: Add test for timer management parser Yang Gu
@ 2010-05-13 20:37 ` Denis Kenzior
  2010-05-14  8:37   ` Gu, Yang
  26 siblings, 1 reply; 29+ messages in thread
From: Denis Kenzior @ 2010-05-13 20:37 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

Hi Yang,

> ---
>  src/stkutil.c |   28 ++++++++++++++++++++++++++++
>  src/stkutil.h |    5 +++++
>  2 files changed, 33 insertions(+), 0 deletions(-)
> 

All 27 patches have been applied with some cleanups interspersed.

Thanks,
-Denis 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH 01/27] stk: Add poll interval proactive command parser
  2010-05-13 20:37 ` [PATCH 01/27] stk: Add poll interval proactive command parser Denis Kenzior
@ 2010-05-14  8:37   ` Gu, Yang
  0 siblings, 0 replies; 29+ messages in thread
From: Gu, Yang @ 2010-05-14  8:37 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

Hi Denis,
	I rethink about my second question (parse_dataobj() shouldn't eat the cake that not belongs to it) on IRC, and may find a case to defense my point.
	The example is ber-tlv launch browser. The similarity to setup_menu is that they all contain a list, while the difference is the list in lanuch browser is optional. Below are the objects within launch browser: browser id(M), URL(O), bearer(O),provisioning file 1(O), provisioning file 2(O),...,provisioning file N(O), text string(O), ...
	Then we may call parse_dataobj(browser id, URL, bearer) to parse the objects before provisioning files, then use parse_provisioning_file_list() to parse provisioning files, and at last call parse_dataobj() again to parse the rest. If there is no provisioning file at all, the situation is same to call parse_dataobj() one after another. If so, we may read object text string in first parse_dataobj(), and at the beginning of second parse_dataobj(), we would move forward again, which could be wrong.
	Thus I think the solution is parse_dataobj() needs to restore the iter it can't consume. What's your opinion?

Regards,
-Yang


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2010-05-14  8:37 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 02/27] test-stkutil: Add test for poll interval parser Yang Gu
2010-05-13 10:48 ` [PATCH 03/27] stkutil: Add setup menu proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 04/27] test-stkutil: Add test for setup menu parser Yang Gu
2010-05-13 10:48 ` [PATCH 05/27] stkutil: Add select item proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 06/27] test-stkutil: Add test for select item parser Yang Gu
2010-05-13 10:48 ` [PATCH 07/27] test-stkutil: Use dedicated functions to check Yang Gu
2010-05-13 10:48 ` [PATCH 08/27] test-stkutil: Refactor test for send sms parser Yang Gu
2010-05-13 10:48 ` [PATCH 09/27] stk: Adjust the sequence of dataobj Yang Gu
2010-05-13 10:48 ` [PATCH 10/27] stkutil: Add setup call proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 11/27] test-stkutil: Add unit test for setup call parser Yang Gu
2010-05-13 10:48 ` [PATCH 12/27] stkutil: Add refresh proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 13/27] test-stkutil: Add test for refresh parser Yang Gu
2010-05-13 10:48 ` [PATCH 14/27] stkutil: Add polling off proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 15/27] test-stkutil: Add test for polling off parser Yang Gu
2010-05-13 10:48 ` [PATCH 16/27] stkutil: Add provide local info command parser Yang Gu
2010-05-13 10:48 ` [PATCH 17/27] test-stk: Add test for provide local info parser Yang Gu
2010-05-13 10:48 ` [PATCH 18/27] stkutil: Add event list command parser Yang Gu
2010-05-13 10:48 ` [PATCH 19/27] test-stkutil: Add test for event list parser Yang Gu
2010-05-13 10:48 ` [PATCH 20/27] stkutil: Add perform card apdu command parser Yang Gu
2010-05-13 10:48 ` [PATCH 21/27] test-stk: Add test for perform card apdu parser Yang Gu
2010-05-13 10:48 ` [PATCH 22/27] stkutil: Add power off card command parser Yang Gu
2010-05-13 10:48 ` [PATCH 23/27] stkutil: Add power on " Yang Gu
2010-05-13 10:48 ` [PATCH 24/27] stkutil: Add get reader status " Yang Gu
2010-05-13 10:48 ` [PATCH 25/27] test-stk: Add test for get reader status parser Yang Gu
2010-05-13 10:48 ` [PATCH 26/27] stkutil: Add timer management command parser Yang Gu
2010-05-13 10:48 ` [PATCH 27/27] test-stk: Add test for timer management parser Yang Gu
2010-05-13 20:37 ` [PATCH 01/27] stk: Add poll interval proactive command parser Denis Kenzior
2010-05-14  8:37   ` Gu, Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.