All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] stk: Add parser for send ss commands
@ 2010-06-13  9:43 Yang Gu
  2010-06-13  9:43 ` [PATCH 02/12] teststk: Add test for send ss parser Yang Gu
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/src/stkutil.c b/src/stkutil.c
index 8ac1dba..642e141 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -499,6 +499,32 @@ static gboolean parse_dataobj_gsm_sms_tpdu(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.14 */
+static gboolean parse_dataobj_ss(struct comprehension_tlv_iter *iter,
+					void *user)
+{
+	struct stk_ss *ss = user;
+	const unsigned char *data;
+	unsigned int len;
+	char *s;
+
+	len = comprehension_tlv_iter_get_length(iter);
+	if (len < 2)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	s = g_try_malloc(len * 2 - 1);
+	if (s == NULL)
+		return FALSE;
+
+	ss->ton_npi = data[0];
+	ss->ss = s;
+	sim_extract_bcd_number(data + 1, len - 1, ss->ss);
+
+	return TRUE;
+}
+
 /* Defined in TS 102.223 Section 8.15 */
 static gboolean parse_dataobj_text(struct comprehension_tlv_iter *iter,
 					void *user)
@@ -1864,6 +1890,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_result;
 	case STK_DATA_OBJECT_TYPE_GSM_SMS_TPDU:
 		return parse_dataobj_gsm_sms_tpdu;
+	case STK_DATA_OBJECT_TYPE_SS_STRING:
+		return parse_dataobj_ss;
 	case STK_DATA_OBJECT_TYPE_TEXT:
 		return parse_dataobj_text;
 	case STK_DATA_OBJECT_TYPE_TONE:
@@ -2537,6 +2565,45 @@ static gboolean parse_send_sms(struct stk_command *command,
 	return TRUE;
 }
 
+static void destroy_send_ss(struct stk_command *command)
+{
+	g_free(command->send_ss.alpha_id);
+	g_free(command->send_ss.ss.ss);
+}
+
+static gboolean parse_send_ss(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_send_ss *obj = &command->send_ss;
+	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,
+				STK_DATA_OBJECT_TYPE_SS_STRING,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->ss,
+				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);
+
+	command->destructor = destroy_send_ss;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
 static void destroy_setup_call(struct stk_command *command)
 {
 	g_free(command->setup_call.alpha_id_usr_cfm);
@@ -3062,6 +3129,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_SEND_SS:
+		ok = parse_send_ss(command, &iter);
+		break;
 	case STK_COMMAND_TYPE_SETUP_CALL:
 		ok = parse_setup_call(command, &iter);
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 2da787d..d73d5e1 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -525,6 +525,12 @@ struct stk_result {
 	unsigned char *additional;
 };
 
+/* Defined in TS 102.223 Section 8.14 */
+struct stk_ss {
+	unsigned char ton_npi;
+	char *ss;
+};
+
 /* Define the struct of single file in TS102.223 Section 8.18.
  * According to TS 11.11 Section 6.2, each file id has two bytes, and the
  * maximum Dedicated File level is 2. So the maximum size of file is 8, which
@@ -933,6 +939,14 @@ struct stk_command_send_sms {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_send_ss {
+	char *alpha_id;
+	struct stk_ss ss;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
 struct stk_command_setup_call {
 	char *alpha_id_usr_cfm;
 	struct stk_address addr;
@@ -1028,6 +1042,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_send_ss send_ss;
 		struct stk_command_setup_call setup_call;
 		struct stk_command_setup_event_list setup_event_list;
 		struct stk_command_perform_card_apdu perform_card_apdu;
-- 
1.7.0.4


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

* [PATCH 02/12] teststk: Add test for send ss parser
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-13  9:43 ` [PATCH 03/12] stk: Add parser for send ussd commands Yang Gu
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 404f092..3f6a31a 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -272,6 +272,14 @@ static void check_gsm_sms(const struct sms *command,
 	}
 }
 
+/* Defined in TS 102.223 Section 8.14 */
+static inline void check_ss(const struct stk_ss *command,
+					const struct stk_ss *test)
+{
+	g_assert(command->ton_npi == test->ton_npi);
+	check_common_text(command->ss, test->ss);
+}
+
 /* Defined in TS 102.223 Section 8.15 */
 static inline void check_text(const char *command, const char *test)
 {
@@ -8732,6 +8740,977 @@ static void test_send_sms(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct send_ss_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	char *alpha_id;
+	struct stk_ss ss;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+static unsigned char send_ss_111[] = { 0xD0, 0x29, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0C, 0x43, 0x61, 0x6C,
+						0x6C, 0x20, 0x46, 0x6F, 0x72,
+						0x77, 0x61, 0x72, 0x64, 0x89,
+						0x10, 0x91, 0xAA, 0x12, 0x0A,
+						0x21, 0x43, 0x65, 0x87, 0x09,
+						0x21, 0x43, 0x65, 0x87, 0xA9,
+						0x01, 0xFB };
+
+static unsigned char send_ss_141[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0C, 0x43, 0x61, 0x6C,
+						0x6C, 0x20, 0x46, 0x6F, 0x72,
+						0x77, 0x61, 0x72, 0x64, 0x89,
+						0x14, 0x91, 0xAA, 0x12, 0x0A,
+						0x21, 0x43, 0x65, 0x87, 0x09,
+						0x21, 0x43, 0x65, 0x87, 0x09,
+						0x21, 0x43, 0x65, 0xA7, 0x11,
+						0xFB };
+
+static unsigned char send_ss_151[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
+						0x11, 0x00, 0x82, 0x02, 0x81,
+						0x83, 0x85, 0x81, 0xEB, 0x45,
+						0x76, 0x65, 0x6E, 0x20, 0x69,
+						0x66, 0x20, 0x74, 0x68, 0x65,
+						0x20, 0x46, 0x69, 0x78, 0x65,
+						0x64, 0x20, 0x44, 0x69, 0x61,
+						0x6C, 0x6C, 0x69, 0x6E, 0x67,
+						0x20, 0x4E, 0x75, 0x6D, 0x62,
+						0x65, 0x72, 0x20, 0x73, 0x65,
+						0x72, 0x76, 0x69, 0x63, 0x65,
+						0x20, 0x69, 0x73, 0x20, 0x65,
+						0x6E, 0x61, 0x62, 0x6C, 0x65,
+						0x64, 0x2C, 0x20, 0x74, 0x68,
+						0x65, 0x20, 0x73, 0x75, 0x70,
+						0x70, 0x6C, 0x65, 0x6D, 0x65,
+						0x6E, 0x74, 0x61, 0x72, 0x79,
+						0x20, 0x73, 0x65, 0x72, 0x76,
+						0x69, 0x63, 0x65, 0x20, 0x63,
+						0x6F, 0x6E, 0x74, 0x72, 0x6F,
+						0x6C, 0x20, 0x73, 0x74, 0x72,
+						0x69, 0x6E, 0x67, 0x20, 0x69,
+						0x6E, 0x63, 0x6C, 0x75, 0x64,
+						0x65, 0x64, 0x20, 0x69, 0x6E,
+						0x20, 0x74, 0x68, 0x65, 0x20,
+						0x53, 0x45, 0x4E, 0x44, 0x20,
+						0x53, 0x53, 0x20, 0x70, 0x72,
+						0x6F, 0x61, 0x63, 0x74, 0x69,
+						0x76, 0x65, 0x20, 0x63, 0x6F,
+						0x6D, 0x6D, 0x61, 0x6E, 0x64,
+						0x20, 0x73, 0x68, 0x61, 0x6C,
+						0x6C, 0x20, 0x6E, 0x6F, 0x74,
+						0x20, 0x62, 0x65, 0x20, 0x63,
+						0x68, 0x65, 0x63, 0x6B, 0x65,
+						0x64, 0x20, 0x61, 0x67, 0x61,
+						0x69, 0x6E, 0x73, 0x74, 0x20,
+						0x74, 0x68, 0x6F, 0x73, 0x65,
+						0x20, 0x6F, 0x66, 0x20, 0x74,
+						0x68, 0x65, 0x20, 0x46, 0x44,
+						0x4E, 0x20, 0x6C, 0x69, 0x73,
+						0x74, 0x2E, 0x20, 0x55, 0x70,
+						0x6F, 0x6E, 0x20, 0x72, 0x65,
+						0x63, 0x65, 0x69, 0x76, 0x69,
+						0x6E, 0x67, 0x20, 0x74, 0x68,
+						0x69, 0x73, 0x20, 0x63, 0x6F,
+						0x6D, 0x6D, 0x61, 0x6E, 0x64,
+						0x2C, 0x20, 0x74, 0x68, 0x65,
+						0x20, 0x4D, 0x45, 0x20, 0x73,
+						0x68, 0x61, 0x6C, 0x6C, 0x20,
+						0x64, 0x65, 0x63, 0x69, 0x89,
+						0x04, 0xFF, 0xBA, 0x13, 0xFB };
+
+static unsigned char send_ss_161[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x00, 0x89, 0x10, 0x91,
+						0xAA, 0x12, 0x0A, 0x21, 0x43,
+						0x65, 0x87, 0x09, 0x21, 0x43,
+						0x65, 0x87, 0xA9, 0x01, 0xFB };
+
+static unsigned char send_ss_211[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x42, 0x61, 0x73,
+						0x69, 0x63, 0x20, 0x49, 0x63,
+						0x6F, 0x6E, 0x89, 0x10, 0x91,
+						0xAA, 0x12, 0x0A, 0x21, 0x43,
+						0x65, 0x87, 0x09, 0x21, 0x43,
+						0x65, 0x87, 0xA9, 0x01, 0xFB,
+						0x9E, 0x02, 0x00, 0x01 };
+
+static unsigned char send_ss_221[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0B, 0x43, 0x6F, 0x6C,
+						0x6F, 0x75, 0x72, 0x20, 0x49,
+						0x63, 0x6F, 0x6E, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0x9E, 0x02, 0x00, 0x02 };
+
+static unsigned char send_ss_231[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x42, 0x61, 0x73,
+						0x69, 0x63, 0x20, 0x49, 0x63,
+						0x6F, 0x6E, 0x89, 0x10, 0x91,
+						0xAA, 0x12, 0x0A, 0x21, 0x43,
+						0x65, 0x87, 0x09, 0x21, 0x43,
+						0x65, 0x87, 0xA9, 0x01, 0xFB,
+						0x9E, 0x02, 0x01, 0x01 };
+
+static unsigned char send_ss_241[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x89, 0x0E, 0x91, 0xAA, 0x12,
+						0x0A, 0x21, 0x43, 0x65, 0x87,
+						0x09, 0x21, 0x43, 0x65, 0x87,
+						0xB9, 0x9E, 0x02, 0x01, 0x01 };
+
+static unsigned char send_ss_311[] = { 0xD0, 0x36, 0x81, 0x03, 0x01, 0x11,
+						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, 0x89, 0x10, 0x91,
+						0xAA, 0x12, 0x0A, 0x21, 0x43,
+						0x65, 0x87, 0x09, 0x21, 0x43,
+						0x65, 0x87, 0xA9, 0x01, 0xFB };
+
+static unsigned char send_ss_411[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_412[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_421[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x01, 0xB4 };
+
+static unsigned char send_ss_422[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_431[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x02, 0xB4 };
+
+static unsigned char send_ss_432[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_441[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x04, 0xB4 };
+
+static unsigned char send_ss_442[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_443[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_451[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x08, 0xB4 };
+
+static unsigned char send_ss_452[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_453[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_461[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x10, 0xB4 };
+
+static unsigned char send_ss_462[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_463[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_471[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x20, 0xB4 };
+
+static unsigned char send_ss_472[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_473[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_481[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x40, 0xB4 };
+
+static unsigned char send_ss_482[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_483[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_491[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x80, 0xB4 };
+
+static unsigned char send_ss_492[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_493[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_4101[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB, 0xD0, 0x04, 0x00, 0x10,
+						0x00, 0xB4 };
+
+static unsigned char send_ss_4102[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x89, 0x10,
+						0x91, 0xAA, 0x12, 0x0A, 0x21,
+						0x43, 0x65, 0x87, 0x09, 0x21,
+						0x43, 0x65, 0x87, 0xA9, 0x01,
+						0xFB };
+
+static unsigned char send_ss_511[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x05, 0x80, 0x4F, 0x60,
+						0x59, 0x7D, 0x89, 0x10, 0x91,
+						0xAA, 0x12, 0x0A, 0x21, 0x43,
+						0x65, 0x87, 0x09, 0x21, 0x43,
+						0x65, 0x87, 0xA9, 0x01, 0xFB };
+
+static unsigned char send_ss_611[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x11,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x03, 0x80, 0x30, 0xEB,
+						0x89, 0x10, 0x91, 0xAA, 0x12,
+						0x0A, 0x21, 0x43, 0x65, 0x87,
+						0x09, 0x21, 0x43, 0x65, 0x87,
+						0xA9, 0x01, 0xFB };
+
+static struct send_ss_test send_ss_data_111 = {
+	.pdu = send_ss_111,
+	.pdu_len = sizeof(send_ss_111),
+	.qualifier = 0x00,
+	.alpha_id = "Call Forward",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_141 = {
+	.pdu = send_ss_141,
+	.pdu_len = sizeof(send_ss_141),
+	.qualifier = 0x00,
+	.alpha_id = "Call Forward",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*0123456789012345678901234567*11#"
+	}
+};
+
+static struct send_ss_test send_ss_data_151 = {
+	.pdu = send_ss_151,
+	.pdu_len = sizeof(send_ss_151),
+	.qualifier = 0x00,
+	.alpha_id = "Even if the Fixed Dialling Number service is enabled, the "
+		"supplementary service control string included in the SEND SS "
+		"proactive command shall not be checked against those of the "
+		"FDN list. Upon receiving this command, the ME shall deci",
+	.ss = {
+		.ton_npi = 0xFF,
+		.ss = "*#31#"
+	}
+};
+
+static struct send_ss_test send_ss_data_161 = {
+	.pdu = send_ss_161,
+	.pdu_len = sizeof(send_ss_161),
+	.qualifier = 0x00,
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_211 = {
+	.pdu = send_ss_211,
+	.pdu_len = sizeof(send_ss_211),
+	.qualifier = 0x00,
+	.alpha_id = "Basic Icon",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct send_ss_test send_ss_data_221 = {
+	.pdu = send_ss_221,
+	.pdu_len = sizeof(send_ss_221),
+	.qualifier = 0x00,
+	.alpha_id = "Colour Icon",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x02
+	}
+};
+
+static struct send_ss_test send_ss_data_231 = {
+	.pdu = send_ss_231,
+	.pdu_len = sizeof(send_ss_231),
+	.qualifier = 0x00,
+	.alpha_id = "Basic Icon",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct send_ss_test send_ss_data_241 = {
+	.pdu = send_ss_241,
+	.pdu_len = sizeof(send_ss_241),
+	.qualifier = 0x00,
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789#"
+	},
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct send_ss_test send_ss_data_311 = {
+	.pdu = send_ss_311,
+	.pdu_len = sizeof(send_ss_311),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_411 = {
+	.pdu = send_ss_411,
+	.pdu_len = sizeof(send_ss_411),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_412 = {
+	.pdu = send_ss_412,
+	.pdu_len = sizeof(send_ss_412),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_421 = {
+	.pdu = send_ss_421,
+	.pdu_len = sizeof(send_ss_421),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x01, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_422 = {
+	.pdu = send_ss_422,
+	.pdu_len = sizeof(send_ss_422),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_431 = {
+	.pdu = send_ss_431,
+	.pdu_len = sizeof(send_ss_431),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x02, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_432 = {
+	.pdu = send_ss_432,
+	.pdu_len = sizeof(send_ss_432),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_441 = {
+	.pdu = send_ss_441,
+	.pdu_len = sizeof(send_ss_441),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x04, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_442 = {
+	.pdu = send_ss_442,
+	.pdu_len = sizeof(send_ss_442),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_443 = {
+	.pdu = send_ss_443,
+	.pdu_len = sizeof(send_ss_443),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_451 = {
+	.pdu = send_ss_451,
+	.pdu_len = sizeof(send_ss_451),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x08, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_452 = {
+	.pdu = send_ss_452,
+	.pdu_len = sizeof(send_ss_452),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_453 = {
+	.pdu = send_ss_453,
+	.pdu_len = sizeof(send_ss_453),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_461 = {
+	.pdu = send_ss_461,
+	.pdu_len = sizeof(send_ss_461),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x10, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_462 = {
+	.pdu = send_ss_462,
+	.pdu_len = sizeof(send_ss_462),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_463 = {
+	.pdu = send_ss_463,
+	.pdu_len = sizeof(send_ss_463),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_471 = {
+	.pdu = send_ss_471,
+	.pdu_len = sizeof(send_ss_471),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x20, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_472 = {
+	.pdu = send_ss_472,
+	.pdu_len = sizeof(send_ss_472),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_473 = {
+	.pdu = send_ss_473,
+	.pdu_len = sizeof(send_ss_473),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_481 = {
+	.pdu = send_ss_481,
+	.pdu_len = sizeof(send_ss_481),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x40, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_482 = {
+	.pdu = send_ss_482,
+	.pdu_len = sizeof(send_ss_482),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_483 = {
+	.pdu = send_ss_483,
+	.pdu_len = sizeof(send_ss_483),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_491 = {
+	.pdu = send_ss_491,
+	.pdu_len = sizeof(send_ss_491),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x80, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_492 = {
+	.pdu = send_ss_492,
+	.pdu_len = sizeof(send_ss_492),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_493 = {
+	.pdu = send_ss_493,
+	.pdu_len = sizeof(send_ss_493),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_4101 = {
+	.pdu = send_ss_4101,
+	.pdu_len = sizeof(send_ss_4101),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	},
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ss_test send_ss_data_4102 = {
+	.pdu = send_ss_4102,
+	.pdu_len = sizeof(send_ss_4102),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_511 = {
+	.pdu = send_ss_511,
+	.pdu_len = sizeof(send_ss_511),
+	.qualifier = 0x00,
+	.alpha_id = "你好",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static struct send_ss_test send_ss_data_611 = {
+	.pdu = send_ss_611,
+	.pdu_len = sizeof(send_ss_611),
+	.qualifier = 0x00,
+	.alpha_id = "ル",
+	.ss = {
+		.ton_npi = 0x91,
+		.ss = "**21*01234567890123456789*10#"
+	}
+};
+
+static void test_send_ss(gconstpointer data)
+{
+	const struct send_ss_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_SEND_SS);
+	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->send_ss.alpha_id, test->alpha_id);
+	check_ss(&command->send_ss.ss, &test->ss);
+	check_icon_id(&command->send_ss.icon_id, &test->icon_id);
+	check_text_attr(&command->send_ss.text_attr, &test->text_attr);
+	check_frame_id(&command->send_ss.frame_id, &test->frame_id);
+
+	stk_command_free(command);
+}
+
 struct setup_call_test {
 	const unsigned char *pdu;
 	unsigned int pdu_len;
@@ -19224,6 +20203,81 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Send SMS 6.1.3",
 				&send_sms_data_613, test_send_sms);
 
+	g_test_add_data_func("/teststk/Send SS 1.1.1",
+				&send_ss_data_111, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 1.4.1",
+				&send_ss_data_141, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 1.5.1",
+				&send_ss_data_151, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 1.6.1",
+				&send_ss_data_161, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 2.1.1",
+				&send_ss_data_211, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 2.2.1",
+				&send_ss_data_221, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 2.3.1",
+				&send_ss_data_231, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 2.4.1",
+				&send_ss_data_241, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 3.1.1",
+				&send_ss_data_311, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.1.1",
+				&send_ss_data_411, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.1.2",
+				&send_ss_data_412, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.2.1",
+				&send_ss_data_421, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.2.2",
+				&send_ss_data_422, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.3.1",
+				&send_ss_data_431, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.3.2",
+				&send_ss_data_432, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.4.1",
+				&send_ss_data_441, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.4.2",
+				&send_ss_data_442, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.4.3",
+				&send_ss_data_443, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.5.1",
+				&send_ss_data_451, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.5.2",
+				&send_ss_data_452, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.5.3",
+				&send_ss_data_453, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.6.1",
+				&send_ss_data_461, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.6.2",
+				&send_ss_data_462, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.6.3",
+				&send_ss_data_463, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.7.1",
+				&send_ss_data_471, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.7.2",
+				&send_ss_data_472, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.7.3",
+				&send_ss_data_473, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.8.1",
+				&send_ss_data_481, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.8.2",
+				&send_ss_data_482, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.8.3",
+				&send_ss_data_483, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.9.1",
+				&send_ss_data_491, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.9.2",
+				&send_ss_data_492, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.9.3",
+				&send_ss_data_493, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.10.1",
+				&send_ss_data_4101, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 4.10.2",
+				&send_ss_data_4102, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 5.1.1",
+				&send_ss_data_511, test_send_ss);
+	g_test_add_data_func("/teststk/Send SS 6.1.1",
+				&send_ss_data_611, test_send_ss);
+
 	g_test_add_data_func("/teststk/Send SMS response 1.1.1",
 				&send_sms_response_data_111,
 				test_terminal_response_encoding);
-- 
1.7.0.4


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

* [PATCH 03/12] stk: Add parser for send ussd commands
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
  2010-06-13  9:43 ` [PATCH 02/12] teststk: Add test for send ss parser Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-16 22:44   ` Denis Kenzior
  2010-06-13  9:43 ` [PATCH 04/12] teststk: Add test for send ussd parser Yang Gu
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

---
 Makefile.am    |    5 ++-
 src/stkutil.c  |   66 ++++++++++++++++++++++++++++++++++++++++++++
 src/stkutil.h  |    9 ++++++
 src/ussdutil.c |   83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/ussdutil.h |   22 +++++++++++++++
 5 files changed, 183 insertions(+), 2 deletions(-)
 create mode 100644 src/ussdutil.c
 create mode 100644 src/ussdutil.h

diff --git a/Makefile.am b/Makefile.am
index 2ca0703..1cf91fa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -269,7 +269,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) \
 			src/storage.c src/cbs.c src/watch.c src/call-volume.c \
 			src/gprs.c src/idmap.h src/idmap.c \
 			src/radio-settings.c src/stkutil.h src/stkutil.c \
-			src/nettime.c
+			src/nettime.c src/ussdutil.h src/ussdutil.c
 
 src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
 
@@ -384,7 +384,8 @@ unit_objects += $(unit_test_simutil_OBJECTS)
 
 unit_test_stkutil_SOURCES = unit/test-stkutil.c src/util.c \
 				src/storage.c src/smsutil.c \
-				src/simutil.c src/stkutil.c
+				src/simutil.c src/stkutil.c \
+				src/ussdutil.c
 unit_test_stkutil_LDADD = @GLIB_LIBS@
 unit_objects += $(unit_test_stkutil_OBJECTS)
 
diff --git a/src/stkutil.c b/src/stkutil.c
index 642e141..d2c8522 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -29,6 +29,7 @@
 #include <glib.h>
 
 #include <ofono/types.h>
+#include "ussdutil.h"
 #include "smsutil.h"
 #include "stkutil.h"
 #include "simutil.h"
@@ -560,6 +561,27 @@ static gboolean parse_dataobj_tone(struct comprehension_tlv_iter *iter,
 	return parse_dataobj_common_byte(iter, byte);
 }
 
+/* Defined in TS 102.223 Section 8.17 */
+static gboolean parse_dataobj_ussd(struct comprehension_tlv_iter *iter,
+					void *user)
+{
+	char **ussd = user;
+	char *utf8;
+	unsigned int len = comprehension_tlv_iter_get_length(iter);
+	const unsigned char *data = comprehension_tlv_iter_get_data(iter);
+
+	if (len <= 1)
+		return FALSE;
+
+	utf8 = ussd_decode(data[0], len - 1, data + 1);
+
+	if (utf8 == NULL)
+		return FALSE;
+
+	*ussd = utf8;
+	return TRUE;
+}
+
 /* Defined in TS 102.223 Section 8.18 */
 static gboolean parse_dataobj_file_list(struct comprehension_tlv_iter *iter,
 					void *user)
@@ -1896,6 +1918,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_text;
 	case STK_DATA_OBJECT_TYPE_TONE:
 		return parse_dataobj_tone;
+	case STK_DATA_OBJECT_TYPE_USSD_STRING:
+		return parse_dataobj_ussd;
 	case STK_DATA_OBJECT_TYPE_FILE_LIST:
 		return parse_dataobj_file_list;
 	case STK_DATA_OBJECT_TYPE_LOCATION_INFO:
@@ -2604,6 +2628,45 @@ static gboolean parse_send_ss(struct stk_command *command,
 	return TRUE;
 }
 
+static void destroy_send_ussd(struct stk_command *command)
+{
+	g_free(command->send_ussd.alpha_id);
+	g_free(command->send_ussd.ussd);
+}
+
+static gboolean parse_send_ussd(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_send_ussd *obj = &command->send_ussd;
+	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,
+				STK_DATA_OBJECT_TYPE_USSD_STRING,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->ussd,
+				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);
+
+	command->destructor = destroy_send_ussd;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
 static void destroy_setup_call(struct stk_command *command)
 {
 	g_free(command->setup_call.alpha_id_usr_cfm);
@@ -3132,6 +3195,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_SEND_SS:
 		ok = parse_send_ss(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_SEND_USSD:
+		ok = parse_send_ussd(command, &iter);
+		break;
 	case STK_COMMAND_TYPE_SETUP_CALL:
 		ok = parse_setup_call(command, &iter);
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index d73d5e1..b6fb85b 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -947,6 +947,14 @@ struct stk_command_send_ss {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_send_ussd {
+	char *alpha_id;
+	char *ussd;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
 struct stk_command_setup_call {
 	char *alpha_id_usr_cfm;
 	struct stk_address addr;
@@ -1043,6 +1051,7 @@ struct stk_command {
 		struct stk_command_select_item select_item;
 		struct stk_command_send_sms send_sms;
 		struct stk_command_send_ss send_ss;
+		struct stk_command_send_ussd send_ussd;
 		struct stk_command_setup_call setup_call;
 		struct stk_command_setup_event_list setup_event_list;
 		struct stk_command_perform_card_apdu perform_card_apdu;
diff --git a/src/ussdutil.c b/src/ussdutil.c
new file mode 100644
index 0000000..b2f3d49
--- /dev/null
+++ b/src/ussdutil.c
@@ -0,0 +1,83 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2010  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include "smsutil.h"
+#include "ussdutil.h"
+#include "util.h"
+
+char *ussd_decode(int dcs, int len, const unsigned char *data)
+{
+	gboolean udhi;
+	enum sms_charset charset;
+	gboolean compressed;
+	gboolean iso639;
+	char *utf8;
+
+	if (!cbs_dcs_decode(dcs, &udhi, NULL, &charset,
+				&compressed, NULL, &iso639))
+		return NULL;
+
+	if (udhi || compressed || iso639)
+		return NULL;
+
+	switch (charset) {
+	case SMS_CHARSET_7BIT:
+	{
+		long written;
+		unsigned char *unpacked = unpack_7bit(data, len, 0, TRUE, 0,
+							&written, 0);
+		if (unpacked == NULL)
+			return NULL;
+
+		utf8 = convert_gsm_to_utf8(unpacked, written, NULL, NULL, 0);
+		g_free(unpacked);
+
+		break;
+	}
+	case SMS_CHARSET_8BIT:
+		utf8 = convert_gsm_to_utf8(data, len, NULL, NULL, 0);
+		break;
+	case SMS_CHARSET_UCS2:
+		utf8 = g_convert((const gchar *) data, len,
+					"UTF-8//TRANSLIT", "UCS-2BE",
+					NULL, NULL, NULL);
+		break;
+	default:
+		utf8 = NULL;
+	}
+
+	return utf8;
+}
diff --git a/src/ussdutil.h b/src/ussdutil.h
new file mode 100644
index 0000000..17bb79c
--- /dev/null
+++ b/src/ussdutil.h
@@ -0,0 +1,22 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2010  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+char *ussd_decode(int dcs, int len, const unsigned char *data);
-- 
1.7.0.4


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

* [PATCH 04/12] teststk: Add test for send ussd parser
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
  2010-06-13  9:43 ` [PATCH 02/12] teststk: Add test for send ss parser Yang Gu
  2010-06-13  9:43 ` [PATCH 03/12] stk: Add parser for send ussd commands Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-13  9:43 ` [PATCH 05/12] Modify " Yang Gu
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 3f6a31a..507d86d 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -293,6 +293,12 @@ static inline void check_tone(const ofono_bool_t command,
 	check_common_bool(command, test);
 }
 
+/* Defined in TS 102.223 Section 8.17 */
+static inline void check_ussd(const char *command, const char *test)
+{
+	check_common_text(command, test);
+}
+
 /* Defined in TS 102.223 Section 8.18 */
 static void check_file_list(GSList *command, const struct stk_file *test)
 {
@@ -9711,6 +9717,1238 @@ static void test_send_ss(gconstpointer data)
 	stk_command_free(command);
 }
 
+struct send_ussd_test {
+	const unsigned char *pdu;
+	unsigned int pdu_len;
+	unsigned char qualifier;
+	char *alpha_id;
+	char *ussd;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+static unsigned char send_ussd_111[] = { 0xD0, 0x50, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x37, 0x2D, 0x62,
+						0x69, 0x74, 0x20, 0x55, 0x53,
+						0x53, 0x44, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60 };
+
+static unsigned char send_ussd_121[] = { 0xD0, 0x58, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x38, 0x2D, 0x62,
+						0x69, 0x74, 0x20, 0x55, 0x53,
+						0x53, 0x44, 0x8A, 0x41, 0x44,
+						0x41, 0x42, 0x43, 0x44, 0x45,
+						0x46, 0x47, 0x48, 0x49, 0x4A,
+						0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+						0x50, 0x51, 0x52, 0x53, 0x54,
+						0x55, 0x56, 0x57, 0x58, 0x59,
+						0x5A, 0x2D, 0x61, 0x62, 0x63,
+						0x64, 0x65, 0x66, 0x67, 0x68,
+						0x69, 0x6A, 0x6B, 0x6C, 0x6D,
+						0x6E, 0x6F, 0x70, 0x71, 0x72,
+						0x73, 0x74, 0x75, 0x76, 0x77,
+						0x78, 0x79, 0x7A, 0x2D, 0x31,
+						0x32, 0x33, 0x34, 0x35, 0x36,
+						0x37, 0x38, 0x39, 0x30 };
+
+static unsigned char send_ussd_131[] = { 0xD0, 0x2F, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x09, 0x55, 0x43, 0x53,
+						0x32, 0x20, 0x55, 0x53, 0x53,
+						0x44, 0x8A, 0x19, 0x48, 0x04,
+						0x17, 0x04, 0x14, 0x04, 0x20,
+						0x04, 0x10, 0x04, 0x12, 0x04,
+						0x21, 0x04, 0x22, 0x04, 0x12,
+						0x04, 0x23, 0x04, 0x19, 0x04,
+						0x22, 0x04, 0x15 };
+
+static unsigned char send_ussd_161[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
+						0x12, 0x00, 0x82, 0x02, 0x81,
+						0x83, 0x85, 0x81, 0xB6, 0x6F,
+						0x6E, 0x63, 0x65, 0x20, 0x61,
+						0x20, 0x52, 0x45, 0x4C, 0x45,
+						0x41, 0x53, 0x45, 0x20, 0x43,
+						0x4F, 0x4D, 0x50, 0x4C, 0x45,
+						0x54, 0x45, 0x20, 0x6D, 0x65,
+						0x73, 0x73, 0x61, 0x67, 0x65,
+						0x20, 0x63, 0x6F, 0x6E, 0x74,
+						0x61, 0x69, 0x6E, 0x69, 0x6E,
+						0x67, 0x20, 0x74, 0x68, 0x65,
+						0x20, 0x55, 0x53, 0x53, 0x44,
+						0x20, 0x52, 0x65, 0x74, 0x75,
+						0x72, 0x6E, 0x20, 0x52, 0x65,
+						0x73, 0x75, 0x6C, 0x74, 0x20,
+						0x6D, 0x65, 0x73, 0x73, 0x61,
+						0x67, 0x65, 0x20, 0x6E, 0x6F,
+						0x74, 0x20, 0x63, 0x6F, 0x6E,
+						0x74, 0x61, 0x69, 0x6E, 0x69,
+						0x6E, 0x67, 0x20, 0x61, 0x6E,
+						0x20, 0x65, 0x72, 0x72, 0x6F,
+						0x72, 0x20, 0x68, 0x61, 0x73,
+						0x20, 0x62, 0x65, 0x65, 0x6E,
+						0x20, 0x72, 0x65, 0x63, 0x65,
+						0x69, 0x76, 0x65, 0x64, 0x20,
+						0x66, 0x72, 0x6F, 0x6D, 0x20,
+						0x74, 0x68, 0x65, 0x20, 0x6E,
+						0x65, 0x74, 0x77, 0x6F, 0x72,
+						0x6B, 0x2C, 0x20, 0x74, 0x68,
+						0x65, 0x20, 0x4D, 0x45, 0x20,
+						0x73, 0x68, 0x61, 0x6C, 0x6C,
+						0x20, 0x69, 0x6E, 0x66, 0x6F,
+						0x72, 0x6D, 0x20, 0x74, 0x68,
+						0x65, 0x20, 0x53, 0x49, 0x4D,
+						0x20, 0x74, 0x68, 0x61, 0x74,
+						0x20, 0x74, 0x68, 0x65, 0x20,
+						0x63, 0x6F, 0x6D, 0x6D, 0x61,
+						0x6E, 0x64, 0x20, 0x68, 0x61,
+						0x73, 0x8A, 0x39, 0xF0, 0x41,
+						0xE1, 0x90, 0x58, 0x34, 0x1E,
+						0x91, 0x49, 0xE5, 0x92, 0xD9,
+						0x74, 0x3E, 0xA1, 0x51, 0xE9,
+						0x94, 0x5A, 0xB5, 0x5E, 0xB1,
+						0x59, 0x6D, 0x2B, 0x2C, 0x1E,
+						0x93, 0xCB, 0xE6, 0x33, 0x3A,
+						0xAD, 0x5E, 0xB3, 0xDB, 0xEE,
+						0x37, 0x3C, 0x2E, 0x9F, 0xD3,
+						0xEB, 0xF6, 0x3B, 0x3E, 0xAF,
+						0x6F, 0xC5, 0x64, 0x33, 0x5A,
+						0xCD, 0x76, 0xC3, 0xE5, 0x60 };
+
+static unsigned char send_ussd_171[] = { 0xD0, 0x44, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x8A, 0x39, 0xF0, 0x41, 0xE1,
+						0x90, 0x58, 0x34, 0x1E, 0x91,
+						0x49, 0xE5, 0x92, 0xD9, 0x74,
+						0x3E, 0xA1, 0x51, 0xE9, 0x94,
+						0x5A, 0xB5, 0x5E, 0xB1, 0x59,
+						0x6D, 0x2B, 0x2C, 0x1E, 0x93,
+						0xCB, 0xE6, 0x33, 0x3A, 0xAD,
+						0x5E, 0xB3, 0xDB, 0xEE, 0x37,
+						0x3C, 0x2E, 0x9F, 0xD3, 0xEB,
+						0xF6, 0x3B, 0x3E, 0xAF, 0x6F,
+						0xC5, 0x64, 0x33, 0x5A, 0xCD,
+						0x76, 0xC3, 0xE5, 0x60 };
+
+static unsigned char send_ussd_181[] = { 0xD0, 0x46, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x00, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60 };
+
+static unsigned char send_ussd_211[] = { 0xD0, 0x54, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x42, 0x61, 0x73,
+						0x69, 0x63, 0x20, 0x49, 0x63,
+						0x6F, 0x6E, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60, 0x9E, 0x02, 0x00, 0x01 };
+
+static unsigned char send_ussd_221[] = { 0xD0, 0x54, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x43, 0x6F, 0x6C,
+						0x6F, 0x72, 0x20, 0x49, 0x63,
+						0x6F, 0x6E, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60, 0x9E, 0x02, 0x00, 0x02 };
+
+static unsigned char send_ussd_231[] = { 0xD0, 0x54, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x0A, 0x42, 0x61, 0x73,
+						0x69, 0x63, 0x20, 0x49, 0x63,
+						0x6F, 0x6E, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60, 0x9E, 0x02, 0x01, 0x01 };
+
+static unsigned char send_ussd_241[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x8A, 0x39, 0xF0, 0x41, 0xE1,
+						0x90, 0x58, 0x34, 0x1E, 0x91,
+						0x49, 0xE5, 0x92, 0xD9, 0x74,
+						0x3E, 0xA1, 0x51, 0xE9, 0x94,
+						0x5A, 0xB5, 0x5E, 0xB1, 0x59,
+						0x6D, 0x2B, 0x2C, 0x1E, 0x93,
+						0xCB, 0xE6, 0x33, 0x3A, 0xAD,
+						0x5E, 0xB3, 0xDB, 0xEE, 0x37,
+						0x3C, 0x2E, 0x9F, 0xD3, 0xEB,
+						0xF6, 0x3B, 0x3E, 0xAF, 0x6F,
+						0xC5, 0x64, 0x33, 0x5A, 0xCD,
+						0x76, 0xC3, 0xE5, 0x60, 0x9E,
+						0x02, 0x01, 0x01 };
+
+static unsigned char send_ussd_311[] = { 0xD0, 0x5F, 0x81, 0x03, 0x01, 0x12,
+						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, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60 };
+
+static unsigned char send_ussd_411[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_412[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_421[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x01, 0xB4 };
+
+static unsigned char send_ussd_422[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_431[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x02, 0xB4 };
+
+static unsigned char send_ussd_432[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_441[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x04, 0xB4 };
+
+static unsigned char send_ussd_442[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_443[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_451[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x08, 0xB4 };
+
+static unsigned char send_ussd_452[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_453[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_461[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x10, 0xB4 };
+
+static unsigned char send_ussd_462[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_463[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_471[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x20, 0xB4 };
+
+static unsigned char send_ussd_472[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_473[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_481[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x40, 0xB4 };
+
+static unsigned char send_ussd_482[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_483[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_491[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x80, 0xB4 };
+
+static unsigned char send_ussd_492[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_493[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x33, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_4101[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x31, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60, 0xD0, 0x04, 0x00,
+						0x10, 0x00, 0xB4 };
+
+static unsigned char send_ussd_4102[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x10, 0x54, 0x65, 0x78,
+						0x74, 0x20, 0x41, 0x74, 0x74,
+						0x72, 0x69, 0x62, 0x75, 0x74,
+						0x65, 0x20, 0x32, 0x8A, 0x39,
+						0xF0, 0x41, 0xE1, 0x90, 0x58,
+						0x34, 0x1E, 0x91, 0x49, 0xE5,
+						0x92, 0xD9, 0x74, 0x3E, 0xA1,
+						0x51, 0xE9, 0x94, 0x5A, 0xB5,
+						0x5E, 0xB1, 0x59, 0x6D, 0x2B,
+						0x2C, 0x1E, 0x93, 0xCB, 0xE6,
+						0x33, 0x3A, 0xAD, 0x5E, 0xB3,
+						0xDB, 0xEE, 0x37, 0x3C, 0x2E,
+						0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
+						0x3E, 0xAF, 0x6F, 0xC5, 0x64,
+						0x33, 0x5A, 0xCD, 0x76, 0xC3,
+						0xE5, 0x60 };
+
+static unsigned char send_ussd_511[] = { 0xD0, 0x4B, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x05, 0x80, 0x4F, 0x60,
+						0x59, 0x7D, 0x8A, 0x39, 0xF0,
+						0x41, 0xE1, 0x90, 0x58, 0x34,
+						0x1E, 0x91, 0x49, 0xE5, 0x92,
+						0xD9, 0x74, 0x3E, 0xA1, 0x51,
+						0xE9, 0x94, 0x5A, 0xB5, 0x5E,
+						0xB1, 0x59, 0x6D, 0x2B, 0x2C,
+						0x1E, 0x93, 0xCB, 0xE6, 0x33,
+						0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
+						0xEE, 0x37, 0x3C, 0x2E, 0x9F,
+						0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
+						0xAF, 0x6F, 0xC5, 0x64, 0x33,
+						0x5A, 0xCD, 0x76, 0xC3, 0xE5,
+						0x60 };
+
+static unsigned char send_ussd_611[] = { 0xD0, 0x49, 0x81, 0x03, 0x01, 0x12,
+						0x00, 0x82, 0x02, 0x81, 0x83,
+						0x85, 0x03, 0x80, 0x30, 0xEB,
+						0x8A, 0x39, 0xF0, 0x41, 0xE1,
+						0x90, 0x58, 0x34, 0x1E, 0x91,
+						0x49, 0xE5, 0x92, 0xD9, 0x74,
+						0x3E, 0xA1, 0x51, 0xE9, 0x94,
+						0x5A, 0xB5, 0x5E, 0xB1, 0x59,
+						0x6D, 0x2B, 0x2C, 0x1E, 0x93,
+						0xCB, 0xE6, 0x33, 0x3A, 0xAD,
+						0x5E, 0xB3, 0xDB, 0xEE, 0x37,
+						0x3C, 0x2E, 0x9F, 0xD3, 0xEB,
+						0xF6, 0x3B, 0x3E, 0xAF, 0x6F,
+						0xC5, 0x64, 0x33, 0x5A, 0xCD,
+						0x76, 0xC3, 0xE5, 0x60 };
+
+static struct send_ussd_test send_ussd_data_111 = {
+	.pdu = send_ussd_111,
+	.pdu_len = sizeof(send_ussd_111),
+	.qualifier = 0x00,
+	.alpha_id = "7-bit USSD",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_121 = {
+	.pdu = send_ussd_121,
+	.pdu_len = sizeof(send_ussd_121),
+	.qualifier = 0x00,
+	.alpha_id = "8-bit USSD",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_131 = {
+	.pdu = send_ussd_131,
+	.pdu_len = sizeof(send_ussd_131),
+	.qualifier = 0x00,
+	.alpha_id = "UCS2 USSD",
+	.ussd = "ЗДРАВСТВУЙТЕ"
+};
+
+static struct send_ussd_test send_ussd_data_161 = {
+	.pdu = send_ussd_161,
+	.pdu_len = sizeof(send_ussd_161),
+	.qualifier = 0x00,
+	.alpha_id = "once a RELEASE COMPLETE message containing the USSD "
+		"Return Result message not containing an error has been "
+		"received from the network, the ME shall inform the SIM "
+		"that the command has",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_171 = {
+	.pdu = send_ussd_171,
+	.pdu_len = sizeof(send_ussd_171),
+	.qualifier = 0x00,
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_181 = {
+	.pdu = send_ussd_181,
+	.pdu_len = sizeof(send_ussd_181),
+	.qualifier = 0x00,
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_211 = {
+	.pdu = send_ussd_211,
+	.pdu_len = sizeof(send_ussd_211),
+	.qualifier = 0x00,
+	.alpha_id = "Basic Icon",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct send_ussd_test send_ussd_data_221 = {
+	.pdu = send_ussd_221,
+	.pdu_len = sizeof(send_ussd_221),
+	.qualifier = 0x00,
+	.alpha_id = "Color Icon",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+		.id = 0x02
+	}
+};
+
+static struct send_ussd_test send_ussd_data_231 = {
+	.pdu = send_ussd_231,
+	.pdu_len = sizeof(send_ussd_231),
+	.qualifier = 0x00,
+	.alpha_id = "Basic Icon",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+static struct send_ussd_test send_ussd_data_241 = {
+	.pdu = send_ussd_241,
+	.pdu_len = sizeof(send_ussd_241),
+	.qualifier = 0x00,
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.icon_id = {
+		.qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+		.id = 0x01
+	}
+};
+
+/* The ussd is not complete in spec */
+static struct send_ussd_test send_ussd_data_311 = {
+	.pdu = send_ussd_311,
+	.pdu_len = sizeof(send_ussd_311),
+	.qualifier = 0x00,
+	.alpha_id = "ЗДРАВСТВУЙТЕ",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_411 = {
+	.pdu = send_ussd_411,
+	.pdu_len = sizeof(send_ussd_411),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_412 = {
+	.pdu = send_ussd_412,
+	.pdu_len = sizeof(send_ussd_412),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_421 = {
+	.pdu = send_ussd_421,
+	.pdu_len = sizeof(send_ussd_421),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x01, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_422 = {
+	.pdu = send_ussd_422,
+	.pdu_len = sizeof(send_ussd_422),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_431 = {
+	.pdu = send_ussd_431,
+	.pdu_len = sizeof(send_ussd_431),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x02, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_432 = {
+	.pdu = send_ussd_432,
+	.pdu_len = sizeof(send_ussd_432),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_441 = {
+	.pdu = send_ussd_441,
+	.pdu_len = sizeof(send_ussd_441),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x04, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_442 = {
+	.pdu = send_ussd_442,
+	.pdu_len = sizeof(send_ussd_442),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_443 = {
+	.pdu = send_ussd_443,
+	.pdu_len = sizeof(send_ussd_443),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_451 = {
+	.pdu = send_ussd_451,
+	.pdu_len = sizeof(send_ussd_451),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x08, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_452 = {
+	.pdu = send_ussd_452,
+	.pdu_len = sizeof(send_ussd_452),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_453 = {
+	.pdu = send_ussd_453,
+	.pdu_len = sizeof(send_ussd_453),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_461 = {
+	.pdu = send_ussd_461,
+	.pdu_len = sizeof(send_ussd_461),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x10, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_462 = {
+	.pdu = send_ussd_462,
+	.pdu_len = sizeof(send_ussd_462),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_463 = {
+	.pdu = send_ussd_463,
+	.pdu_len = sizeof(send_ussd_463),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_471 = {
+	.pdu = send_ussd_471,
+	.pdu_len = sizeof(send_ussd_471),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x20, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_472 = {
+	.pdu = send_ussd_472,
+	.pdu_len = sizeof(send_ussd_472),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_473 = {
+	.pdu = send_ussd_473,
+	.pdu_len = sizeof(send_ussd_473),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_481 = {
+	.pdu = send_ussd_481,
+	.pdu_len = sizeof(send_ussd_481),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x40, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_482 = {
+	.pdu = send_ussd_482,
+	.pdu_len = sizeof(send_ussd_482),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_483 = {
+	.pdu = send_ussd_483,
+	.pdu_len = sizeof(send_ussd_483),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_491 = {
+	.pdu = send_ussd_491,
+	.pdu_len = sizeof(send_ussd_491),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x80, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_492 = {
+	.pdu = send_ussd_492,
+	.pdu_len = sizeof(send_ussd_492),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_493 = {
+	.pdu = send_ussd_493,
+	.pdu_len = sizeof(send_ussd_493),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 3",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_4101 = {
+	.pdu = send_ussd_4101,
+	.pdu_len = sizeof(send_ussd_4101),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 1",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890",
+	.text_attr = {
+		.len = 4,
+		.attributes = { 0x00, 0x10, 0x00, 0xB4 }
+	}
+};
+
+static struct send_ussd_test send_ussd_data_4102 = {
+	.pdu = send_ussd_4102,
+	.pdu_len = sizeof(send_ussd_4102),
+	.qualifier = 0x00,
+	.alpha_id = "Text Attribute 2",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_511 = {
+	.pdu = send_ussd_511,
+	.pdu_len = sizeof(send_ussd_511),
+	.qualifier = 0x00,
+	.alpha_id = "你好",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static struct send_ussd_test send_ussd_data_611 = {
+	.pdu = send_ussd_611,
+	.pdu_len = sizeof(send_ussd_611),
+	.qualifier = 0x00,
+	.alpha_id = "ル",
+	.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
+		"1234567890"
+};
+
+static void test_send_ussd(gconstpointer data)
+{
+	const struct send_ussd_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_SEND_USSD);
+	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->send_ussd.alpha_id, test->alpha_id);
+	check_ussd(command->send_ussd.ussd, test->ussd);
+	check_icon_id(&command->send_ussd.icon_id, &test->icon_id);
+	check_text_attr(&command->send_ussd.text_attr, &test->text_attr);
+	check_frame_id(&command->send_ussd.frame_id, &test->frame_id);
+
+	stk_command_free(command);
+}
+
 struct setup_call_test {
 	const unsigned char *pdu;
 	unsigned int pdu_len;
@@ -20278,6 +21516,85 @@ int main(int argc, char **argv)
 	g_test_add_data_func("/teststk/Send SS 6.1.1",
 				&send_ss_data_611, test_send_ss);
 
+	g_test_add_data_func("/teststk/Send USSD 1.1.1",
+				&send_ussd_data_111, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 1.2.1",
+				&send_ussd_data_121, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 1.3.1",
+				&send_ussd_data_131, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 1.6.1",
+				&send_ussd_data_161, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 1.7.1",
+				&send_ussd_data_171, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 1.8.1",
+				&send_ussd_data_181, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 2.1.1",
+				&send_ussd_data_211, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 2.2.1",
+				&send_ussd_data_221, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 2.3.1",
+				&send_ussd_data_231, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 2.4.1",
+				&send_ussd_data_241, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 3.1.1",
+				&send_ussd_data_311, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.1.1",
+				&send_ussd_data_411, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.1.2",
+				&send_ussd_data_412, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.2.1",
+				&send_ussd_data_421, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.2.2",
+				&send_ussd_data_422, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.3.1",
+				&send_ussd_data_431, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.3.2",
+				&send_ussd_data_432, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.4.1",
+				&send_ussd_data_441, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.4.2",
+				&send_ussd_data_442, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.4.3",
+				&send_ussd_data_443, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.5.1",
+				&send_ussd_data_451, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.5.2",
+				&send_ussd_data_452, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.5.3",
+				&send_ussd_data_453, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.6.1",
+				&send_ussd_data_461, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.6.2",
+				&send_ussd_data_462, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.6.3",
+				&send_ussd_data_463, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.7.1",
+				&send_ussd_data_471, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.7.2",
+				&send_ussd_data_472, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.7.3",
+				&send_ussd_data_473, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.8.1",
+				&send_ussd_data_481, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.8.2",
+				&send_ussd_data_482, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.8.3",
+				&send_ussd_data_483, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.9.1",
+				&send_ussd_data_491, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.9.2",
+				&send_ussd_data_492, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.9.3",
+				&send_ussd_data_493, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.10.1",
+				&send_ussd_data_4101, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 4.10.2",
+				&send_ussd_data_4102, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 5.1.1",
+				&send_ussd_data_511, test_send_ussd);
+	g_test_add_data_func("/teststk/Send USSD 6.1.1",
+				&send_ussd_data_611, test_send_ussd);
+
 	g_test_add_data_func("/teststk/Send SMS response 1.1.1",
 				&send_sms_response_data_111,
 				test_terminal_response_encoding);
-- 
1.7.0.4


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

* [PATCH 05/12] Modify ussd parser
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (2 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 04/12] teststk: Add test for send ussd parser Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-16 22:48   ` Denis Kenzior
  2010-06-13  9:43 ` [PATCH 06/12] Refactor " Yang Gu
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

* Original code doesn't call unpack_7bit(), which seems not correct.
* An utility function is used to handle it, which supports 8-bit
and ucs2 besides 7-bit character.
* Status is assigned with correct value when error occurs
---
 drivers/atmodem/ussd.c |   33 ++++++---------------------------
 1 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 555ce13..2b006eb 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -40,6 +40,7 @@
 #include "gatresult.h"
 
 #include "atmodem.h"
+#include "ussdutil.h"
 
 struct cusd_req {
 	ofono_ussd_cb_t cb;
@@ -53,14 +54,10 @@ static const char *none_prefix[] = { NULL };
 static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
 {
 	GAtResultIter iter;
-	int status;
 	int dcs;
 	const char *content;
+	int status = OFONO_USSD_STATUS_NOT_SUPPORTED;
 	char *converted = NULL;
-	gboolean udhi;
-	enum sms_charset charset;
-	gboolean compressed;
-	gboolean iso639;
 
 	g_at_result_iter_init(&iter, result);
 
@@ -76,32 +73,14 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
 	if (!g_at_result_iter_next_number(&iter, &dcs))
 		goto out;
 
-	if (!cbs_dcs_decode(dcs, &udhi, NULL, &charset,
-				&compressed, NULL, &iso639))
-		goto out;
-
-	if (udhi || compressed || iso639)
-		goto out;
+	converted = ussd_decode(dcs, strlen(content), (unsigned char *)content);
 
-	if (charset == SMS_CHARSET_7BIT)
-		converted = convert_gsm_to_utf8((const guint8 *) content,
-						strlen(content), NULL, NULL, 0);
-
-	else if (charset == SMS_CHARSET_8BIT) {
-		/* TODO: Figure out what to do with 8 bit data */
-		ofono_error("8-bit coded USSD response received");
-		status = 4; /* Not supported */
-	} else {
-		/* No other encoding is mentioned in TS27007 7.15 */
-		ofono_error("Unsupported USSD data coding scheme (%02x)", dcs);
-		status = 4; /* Not supported */
-	}
+	if (converted)
+		status = OFONO_USSD_STATUS_NOTIFY;
 
 out:
 	ofono_ussd_notify(ussd, status, converted);
-
-	if (converted)
-		g_free(converted);
+	g_free(converted);
 }
 
 static void cusd_request_cb(gboolean ok, GAtResult *result, gpointer user_data)
-- 
1.7.0.4


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

* [PATCH 06/12] Refactor ussd parser
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (3 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 05/12] Modify " Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-16 22:49   ` Denis Kenzior
  2010-06-21 14:08   ` Aki Niemi
  2010-06-13  9:43 ` [PATCH 07/12] Add several proactive command parsers Yang Gu
                   ` (6 subsequent siblings)
  11 siblings, 2 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

---
 drivers/isimodem/ussd.c |   36 +++++++-----------------------------
 1 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/drivers/isimodem/ussd.c b/drivers/isimodem/ussd.c
index 8be20b6..10bee0f 100644
--- a/drivers/isimodem/ussd.c
+++ b/drivers/isimodem/ussd.c
@@ -47,6 +47,7 @@
 #include "isiutil.h"
 #include "ss.h"
 #include "debug.h"
+#include "ussdutil.h"
 
 struct ussd_data {
 	GIsiClient *client;
@@ -73,44 +74,21 @@ static void ussd_parse(struct ofono_ussd *ussd, const void *restrict data,
 			size_t len)
 {
 	const unsigned char *msg = data;
-	unsigned char buf[256];
-	unsigned char *unpacked;
-	long written;
-	int status;
+	int status = OFONO_USSD_STATUS_NOT_SUPPORTED;
 	char *converted = NULL;
-	gboolean udhi;
-	enum sms_charset charset;
-	gboolean compressed;
-	gboolean iso639;
 
 	if (!msg || len < 4)
-		goto error;
+		goto out;
 
 	status = isi_type_to_status(msg[2]);
 
 	if (msg[3] == 0 || (size_t)(msg[3] + 4) > len)
-		goto error;
-
-	if (!cbs_dcs_decode(msg[1], &udhi, NULL, &charset,
-				&compressed, NULL, &iso639))
-		goto error;
-
-	if (udhi || compressed || iso639)
-		goto error;
-
-	if (charset != SMS_CHARSET_7BIT)
-		goto error;
-
-	unpacked = unpack_7bit_own_buf(msg + 4, msg[3], 0, TRUE,
-					SS_MAX_USSD_LENGTH, &written, 0, buf);
+		goto out;
 
-	converted = convert_gsm_to_utf8((const guint8 *)unpacked, written,
-					NULL, NULL, 0);
+	converted = ussd_decode(msg[1], msg[3], msg + 4);
 
-	goto out;
-
-error:
-	status = OFONO_USSD_STATUS_NOT_SUPPORTED;
+	if (converted)
+		status = OFONO_USSD_STATUS_NOTIFY;
 
 out:
 	ofono_ussd_notify(ussd, status, converted);
-- 
1.7.0.4


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

* [PATCH 07/12] Add several proactive command parsers
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (4 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 06/12] Refactor " Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-13  9:43 ` [PATCH 08/12] stk: Add parser for cell broadcast page objects Yang Gu
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

---
 src/stkutil.c |  473 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/stkutil.h |   93 +++++++++++
 2 files changed, 566 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index d2c8522..268d686 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -3107,6 +3107,440 @@ static gboolean parse_launch_browser(struct stk_command *command,
 	return TRUE;
 }
 
+/* TODO: parse_open_channel */
+
+static void destroy_close_channel(struct stk_command *command)
+{
+	g_free(command->close_channel.alpha_id);
+}
+
+static gboolean parse_close_channel(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_close_channel *obj = &command->close_channel;
+	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_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);
+
+	command->destructor = destroy_close_channel;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static void destroy_receive_data(struct stk_command *command)
+{
+	g_free(command->receive_data.alpha_id);
+}
+
+static gboolean parse_receive_data(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_receive_data *obj = &command->receive_data;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CHANNEL_1) ||
+			(command->dst > STK_DEVICE_IDENTITY_TYPE_CHANNEL_7))
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+				&obj->alpha_id,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_CHANNEL_DATA_LENGTH,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->data_len,
+				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);
+
+	command->destructor = destroy_receive_data;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static void destroy_send_data(struct stk_command *command)
+{
+	g_free(command->send_data.alpha_id);
+	g_free(command->send_data.data.array);
+}
+
+static gboolean parse_send_data(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_send_data *obj = &command->send_data;
+	gboolean ret;
+
+	if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+		return FALSE;
+
+	if ((command->dst < STK_DEVICE_IDENTITY_TYPE_CHANNEL_1) ||
+			(command->dst > STK_DEVICE_IDENTITY_TYPE_CHANNEL_7))
+		return FALSE;
+
+	ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+				&obj->alpha_id,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_CHANNEL_DATA,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->data,
+				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);
+
+	command->destructor = destroy_send_data;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static gboolean parse_get_channel_status(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;
+}
+
+static void destroy_service_search(struct stk_command *command)
+{
+	g_free(command->service_search.alpha_id);
+	g_free(command->service_search.serv_search.ser_search);
+	g_free(command->service_search.dev_filter.dev_filter);
+}
+
+static gboolean parse_service_search(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_service_search *obj = &command->service_search;
+	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_ALPHA_ID, 0,
+				&obj->alpha_id,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_SERVICE_SEARCH,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->serv_search,
+				STK_DATA_OBJECT_TYPE_DEVICE_FILTER, 0,
+				&obj->dev_filter,
+				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);
+
+	command->destructor = destroy_service_search;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static void destroy_get_service_info(struct stk_command *command)
+{
+	g_free(command->get_service_info.alpha_id);
+	g_free(command->get_service_info.attr_info.attr_info);
+}
+
+static gboolean parse_get_service_info(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_get_service_info *obj = &command->get_service_info;
+	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_ALPHA_ID, 0,
+				&obj->alpha_id,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_ATTRIBUTE_INFO,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->attr_info,
+				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);
+
+	command->destructor = destroy_get_service_info;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static void destroy_declare_service(struct stk_command *command)
+{
+	g_free(command->declare_service.serv_rec.serv_rec);
+}
+
+static gboolean parse_declare_service(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_declare_service *obj = &command->declare_service;
+	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_SERVICE_RECORD,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->serv_rec,
+				STK_DATA_OBJECT_TYPE_UICC_TE_INTERFACE, 0,
+				&obj->intf,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	command->destructor = destroy_declare_service;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static gboolean parse_set_frames(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_set_frames *obj = &command->set_frames;
+	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_FRAME_ID,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->frame_id,
+				STK_DATA_OBJECT_TYPE_FRAME_LAYOUT, 0,
+				&obj->frame_layout,
+				STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+				&obj->frame_id_default,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static gboolean parse_get_frames_status(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;
+}
+
+static void destroy_retrieve_mms(struct stk_command *command)
+{
+	g_free(command->retrieve_mms.alpha_id);
+	g_slist_foreach(command->retrieve_mms.mms_rec_files,
+						(GFunc)g_free, NULL);
+	g_slist_free(command->retrieve_mms.mms_rec_files);
+}
+
+static gboolean parse_retrieve_mms(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_retrieve_mms *obj = &command->retrieve_mms;
+	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,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_MMS_REFERENCE,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->mms_ref,
+				STK_DATA_OBJECT_TYPE_FILE_LIST,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->mms_rec_files,
+				STK_DATA_OBJECT_TYPE_MMS_CONTENT_ID,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->mms_content_id,
+				STK_DATA_OBJECT_TYPE_MMS_ID, 0,
+				&obj->mms_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);
+
+	command->destructor = destroy_retrieve_mms;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static void destroy_submit_mms(struct stk_command *command)
+{
+	g_free(command->submit_mms.alpha_id);
+	g_slist_foreach(command->submit_mms.mms_subm_files,
+						(GFunc)g_free, NULL);
+	g_slist_free(command->submit_mms.mms_subm_files);
+}
+
+static gboolean parse_submit_mms(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_submit_mms *obj = &command->submit_mms;
+	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,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_FILE_LIST,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->mms_subm_files,
+				STK_DATA_OBJECT_TYPE_MMS_ID, 0,
+				&obj->mms_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);
+
+	command->destructor = destroy_submit_mms;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static void destroy_display_mms(struct stk_command *command)
+{
+	g_slist_foreach(command->display_mms.mms_subm_files,
+						(GFunc)g_free, NULL);
+	g_slist_free(command->display_mms.mms_subm_files);
+}
+
+static gboolean parse_display_mms(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_display_mms *obj = &command->display_mms;
+	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,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->mms_subm_files,
+				STK_DATA_OBJECT_TYPE_MMS_ID,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->mms_id,
+				STK_DATA_OBJECT_TYPE_IMMEDIATE_RESPONSE, 0,
+				&obj->imd_resp,
+				STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+				&obj->frame_id,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	command->destructor = destroy_display_mms;
+
+	if (ret == FALSE)
+		return FALSE;
+
+	return TRUE;
+}
+
+static gboolean parse_activate(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_activate *obj = &command->activate;
+	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_ACTIVATE_DESCRIPTOR,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->actv_desc,
+				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)
 {
@@ -3243,6 +3677,45 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_LAUNCH_BROWSER:
 		ok = parse_launch_browser(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_CLOSE_CHANNEL:
+		ok = parse_close_channel(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_RECEIVE_DATA:
+		ok = parse_receive_data(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_SEND_DATA:
+		ok = parse_send_data(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_GET_CHANNEL_STATUS:
+		ok = parse_get_channel_status(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_SERVICE_SEARCH:
+		ok = parse_service_search(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_GET_SERVICE_INFO:
+		ok = parse_get_service_info(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_DECLARE_SERVICE:
+		ok = parse_declare_service(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_SET_FRAMES:
+		ok = parse_set_frames(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_GET_FRAMES_STATUS:
+		ok = parse_get_frames_status(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_RETRIEVE_MMS:
+		ok = parse_retrieve_mms(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_SUBMIT_MMS:
+		ok = parse_submit_mms(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_DISPLAY_MMS:
+		ok = parse_display_mms(command, &iter);
+		break;
+	case STK_COMMAND_TYPE_ACTIVATE:
+		ok = parse_activate(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index b6fb85b..6ab5ed1 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -1033,6 +1033,88 @@ struct stk_command_launch_browser {
 	char *text_passwd;
 };
 
+struct stk_command_close_channel {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_receive_data {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	unsigned char data_len;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_send_data {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_common_byte_array data;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_service_search {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_service_search serv_search;
+	struct stk_device_filter dev_filter;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_get_service_info {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_attribute_info attr_info;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_declare_service {
+	struct stk_service_record serv_rec;
+	struct stk_uicc_te_interface intf;
+};
+
+struct stk_command_set_frames {
+	struct stk_frame_id frame_id;
+	struct stk_frame_layout frame_layout;
+	struct stk_frame_id frame_id_default;
+};
+
+struct stk_command_retrieve_mms {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	struct stk_mms_reference mms_ref;
+	GSList *mms_rec_files;
+	struct stk_mms_content_id mms_content_id;
+	struct stk_mms_id mms_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_submit_mms {
+	char *alpha_id;
+	struct stk_icon_id icon_id;
+	GSList *mms_subm_files;
+	struct stk_mms_id mms_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_display_mms {
+	GSList *mms_subm_files;
+	struct stk_mms_id mms_id;
+	ofono_bool_t imd_resp;
+	struct stk_frame_id frame_id;
+};
+
+struct stk_command_activate {
+	unsigned char actv_desc;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -1061,6 +1143,17 @@ struct stk_command {
 		struct stk_command_send_dtmf send_dtmf;
 		struct stk_command_language_notification language_notification;
 		struct stk_command_launch_browser launch_browser;
+		struct stk_command_close_channel close_channel;
+		struct stk_command_receive_data receive_data;
+		struct stk_command_send_data send_data;
+		struct stk_command_service_search service_search;
+		struct stk_command_get_service_info get_service_info;
+		struct stk_command_declare_service declare_service;
+		struct stk_command_set_frames set_frames;
+		struct stk_command_retrieve_mms retrieve_mms;
+		struct stk_command_submit_mms submit_mms;
+		struct stk_command_display_mms display_mms;
+		struct stk_command_activate activate;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


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

* [PATCH 08/12] stk: Add parser for cell broadcast page objects
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (5 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 07/12] Add several proactive command parsers Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-13  9:43 ` [PATCH 09/12] stk: Add parser for bcch channel list objects Yang Gu
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/src/stkutil.c b/src/stkutil.c
index 268d686..3ca808f 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -355,6 +355,28 @@ static gboolean parse_dataobj_ccp(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 31.111 Section 8.5 */
+static gboolean parse_dataobj_cbs_page(struct comprehension_tlv_iter *iter,
+					void *user)
+{
+	struct stk_cbs_page *cp = user;
+	const unsigned char *data;
+	unsigned int len;
+
+	len = comprehension_tlv_iter_get_length(iter);
+	if (len < 1)
+		return FALSE;
+
+	if (len > sizeof(cp->page))
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+	cp->len = len;
+	memcpy(cp->page, data, len);
+
+	return TRUE;
+}
+
 /* Described in TS 102.223 Section 8.8 */
 static gboolean parse_dataobj_duration(struct comprehension_tlv_iter *iter,
 					void *user)
@@ -1900,6 +1922,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_subaddress;
 	case STK_DATA_OBJECT_TYPE_CCP:
 		return parse_dataobj_ccp;
+	case STK_DATA_OBJECT_TYPE_CBS_PAGE:
+		return parse_dataobj_cbs_page;
 	case STK_DATA_OBJECT_TYPE_DURATION:
 		return parse_dataobj_duration;
 	case STK_DATA_OBJECT_TYPE_ITEM:
diff --git a/src/stkutil.h b/src/stkutil.h
index 6ab5ed1..b0dcd5f 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -494,6 +494,12 @@ struct stk_ccp {
 	unsigned char ccp[16];
 };
 
+/* Defined in TS 31.111 Section 8.5 */
+struct stk_cbs_page {
+	unsigned char len;
+	unsigned char page[88];
+};
+
 /*
  * According to 102.223 Section 8.8 interval values of 0x00 are reserved.
  * We use this to denote empty duration objects.
-- 
1.7.0.4


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

* [PATCH 09/12] stk: Add parser for bcch channel list objects
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (6 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 08/12] stk: Add parser for cell broadcast page objects Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-13  9:43 ` [PATCH 10/12] stk: Add parser for timing advance objects Yang Gu
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/src/stkutil.c b/src/stkutil.c
index 3ca808f..1631610 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -851,6 +851,33 @@ static gboolean parse_dataobj_transaction_id(
 	return TRUE;
 }
 
+/* Defined in TS 31.111 Section 8.29 */
+static gboolean parse_dataobj_bcch_channel_list(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_bcch_channel_list *bcl = user;
+	const unsigned char *data;
+	unsigned int len = comprehension_tlv_iter_get_length(iter);
+	unsigned int i;
+
+	if (len < 1)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	bcl->num = len * 8 / 10;
+
+	for (i = 0; i < bcl->num; i++) {
+		unsigned int index = i * 10 / 8;
+		unsigned int occupied = i * 10 % 8;
+
+		bcl->channel[i] = (data[index] << (2 + occupied)) +
+					(data[index + 1] >> (6 - occupied));
+	}
+
+	return TRUE;
+}
+
 /* Defined in TS 102.223 Section 8.30 */
 static gboolean parse_dataobj_call_control_requested_action(
 		struct comprehension_tlv_iter *iter, void *user)
@@ -1966,6 +1993,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_location_status;
 	case STK_DATA_OBJECT_TYPE_TRANSACTION_ID:
 		return parse_dataobj_transaction_id;
+	case STK_DATA_OBJECT_TYPE_BCCH_CHANNEL_LIST:
+		return parse_dataobj_bcch_channel_list;
 	case STK_DATA_OBJECT_TYPE_CALL_CONTROL_REQUESTED_ACTION:
 		return parse_dataobj_call_control_requested_action;
 	case STK_DATA_OBJECT_TYPE_ICON_ID:
diff --git a/src/stkutil.h b/src/stkutil.h
index b0dcd5f..20c3c02 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -598,6 +598,16 @@ struct stk_transaction_id {
 };
 
 /*
+ * According to 31.111 Section 8.29 the length of CTLV is 1 byte. This means
+ * that the maximum size is 127 according to the rules of CTLVs. Each channel
+ * is represented as 10 bits, so the maximum number of channel is 127*8/10=101.
+ */
+struct stk_bcch_channel_list {
+	unsigned short channel[101];
+	unsigned int num;
+};
+
+/*
  * Defined in TS 102.223 Section 8.31
  * Icon ID denotes a file on the SIM filesystem.  Since EF cannot have record
  * ids of 0, we use icon_id with 0 to denote empty icon_identifier objects
-- 
1.7.0.4


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

* [PATCH 10/12] stk: Add parser for timing advance objects
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (7 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 09/12] stk: Add parser for bcch channel list objects Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-16 22:50   ` Denis Kenzior
  2010-06-16 23:19   ` andrzej zaborowski
  2010-06-13  9:43 ` [PATCH 11/12] stk: Add parser for PDP activation param objects Yang Gu
                   ` (2 subsequent siblings)
  11 siblings, 2 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

---
 src/stkutil.c       |   22 ++++++++++++++++++++++
 src/stkutil.h       |   28 ++++++++++++++++++----------
 unit/test-stkutil.c |    2 +-
 3 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 1631610..35d9be6 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1145,6 +1145,26 @@ static gboolean parse_dataobj_language(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in 31.111 Section 8.46 */
+static gboolean parse_dataobj_timing_advance(
+			struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_timing_advance *ta = user;
+	const unsigned char *data;
+	unsigned int len = comprehension_tlv_iter_get_length(iter);
+
+	if (len != 2)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	ta->has_value = TRUE;
+	ta->status = data[0];
+	ta->advance = data[1];
+
+	return TRUE;
+}
+
 /* Defined in 102.223 Section 8.47 */
 static gboolean parse_dataobj_browser_id(struct comprehension_tlv_iter *iter,
 						void *user)
@@ -2029,6 +2049,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_language;
 	case STK_DATA_OBJECT_TYPE_BROWSER_ID:
 		return parse_dataobj_browser_id;
+	case STK_DATA_OBJECT_TYPE_TIMING_ADVANCE:
+		return parse_dataobj_timing_advance;
 	case STK_DATA_OBJECT_TYPE_URL:
 		return parse_dataobj_url;
 	case STK_DATA_OBJECT_TYPE_BEARER:
diff --git a/src/stkutil.h b/src/stkutil.h
index 20c3c02..6ccf307 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -447,6 +447,11 @@ enum stk_broadcast_network_technology {
 	STK_BROADCAST_NETWORK_T_DMB = 0x03
 };
 
+enum stk_me_status {
+	STK_ME_STATUS_IDLE = 		0x00,
+	STK_ME_STATUS_NOT_IDLE = 	0x01
+};
+
 /* For data object that only has a byte array with undetermined length */
 struct stk_common_byte_array {
 	unsigned char *array;
@@ -671,6 +676,18 @@ struct stk_timer_value {
 	unsigned char second;
 };
 
+/* Defined in TS 31.111 Section 8.46 */
+struct stk_timing_advance {
+	ofono_bool_t has_value;
+	unsigned char status;
+	/*
+	 * Contains bit periods number according to 3GPP TS
+	 * 44.118 Section 9.3.106 / 3GPP TS 44.018 Section
+	 * 10.5.2.40.1, not microseconds
+	 */
+	unsigned char advance;
+};
+
 /*
  * According to 102.223 Section 8.52 the length of CTLV is 1 byte. This means
  * that the maximum size is 127 according to the rules of CTLVs. This size also
@@ -1229,16 +1246,7 @@ struct stk_response_local_info {
 		const char *language;
 		enum stk_battery_state battery_charge;
 		enum stk_access_technology_type access_technology;
-		struct stk_timing_advance {
-			enum {
-				STK_TIMING_ADVANCE_ME_IDLE = 0x00,
-				STK_TIMING_ADVANCE_ME_NOT_IDLE = 0x01,
-			} status;
-			/* Contains bit periods number according to 3GPP TS
-			 * 44.118 Section 9.3.106 / 3GPP TS 44.018 Section
-			 * 10.5.2.40.1, not microseconds */
-			int advance;
-		} tadv;
+		struct stk_timing_advance tadv;
 		/* Bits[31:24]: manufacturer, bits[23:0]: serial number */
 		guint32 esn;
 		const char *imeisv;
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 507d86d..eab62f0 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -18695,7 +18695,7 @@ static const struct terminal_response_test
 		},
 		{ .provide_local_info = {
 			{ .tadv = {
-				.status = STK_TIMING_ADVANCE_ME_IDLE,
+				.status = STK_ME_STATUS_IDLE,
 				.advance = 0,
 			}},
 		}},
-- 
1.7.0.4


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

* [PATCH 11/12] stk: Add parser for PDP activation param objects
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (8 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 10/12] stk: Add parser for timing advance objects Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-13  9:43 ` [PATCH 12/12] stk: Add parser for UTRAN meas qualifier objects Yang Gu
  2010-06-16 22:42 ` [PATCH 01/12] stk: Add parser for send ss commands Denis Kenzior
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/src/stkutil.c b/src/stkutil.c
index 35d9be6..696e2e0 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1623,6 +1623,27 @@ static gboolean parse_dataobj_text_attr(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 31.111 Section 8.72 */
+static gboolean parse_dataobj_pdp_act_par(
+			struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_pdp_act_par *pcap = user;
+	const unsigned char *data;
+	unsigned int len;
+
+	len = comprehension_tlv_iter_get_length(iter);
+
+	if (len > sizeof(pcap->par))
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	memcpy(pcap->par, data, len);
+	pcap->len = len;
+
+	return TRUE;
+}
+
 /* Defined in TS 102.223 Section 8.73 */
 static gboolean parse_dataobj_item_text_attribute_list(
 		struct comprehension_tlv_iter *iter, void *user)
@@ -2101,6 +2122,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_cdma_sms_tpdu;
 	case STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE:
 		return parse_dataobj_text_attr;
+	case STK_DATA_OBJECT_TYPE_PDP_ACTIVATION_PARAMETER:
+		return parse_dataobj_pdp_act_par;
 	case STK_DATA_OBJECT_TYPE_ITEM_TEXT_ATTRIBUTE_LIST:
 		return parse_dataobj_item_text_attribute_list;
 	case STK_DATA_OBJECT_TYPE_IMEISV:
diff --git a/src/stkutil.h b/src/stkutil.h
index 6ccf307..c6c1af0 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -806,6 +806,12 @@ struct stk_text_attribute {
 	unsigned char len;
 };
 
+/* Defined in TS 31.111 Section 8.72 */
+struct stk_pdp_act_par {
+	unsigned char par[127];
+	unsigned char len;
+};
+
 /*
  * According to 102.223 Section 8.73 the length of CTLV is 1 byte. This means
  * that the maximum size is 127 according to the rules of CTLVs. In addition,
-- 
1.7.0.4


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

* [PATCH 12/12] stk: Add parser for UTRAN meas qualifier objects
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (9 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 11/12] stk: Add parser for PDP activation param objects Yang Gu
@ 2010-06-13  9:43 ` Yang Gu
  2010-06-16 22:42 ` [PATCH 01/12] stk: Add parser for send ss commands Denis Kenzior
  11 siblings, 0 replies; 23+ messages in thread
From: Yang Gu @ 2010-06-13  9:43 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/src/stkutil.c b/src/stkutil.c
index 696e2e0..5282d17 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1663,6 +1663,14 @@ static gboolean parse_dataobj_item_text_attribute_list(
 	return TRUE;
 }
 
+/* Defined in TS 31.111 Section 8.73 */
+static gboolean parse_dataobj_utran_meas_qualifier(
+			struct comprehension_tlv_iter *iter, void *user)
+{
+	unsigned char *byte = user;
+	return parse_dataobj_common_byte(iter, byte);
+}
+
 /*
  * Defined in TS 102.223 Section 8.74.
  *
@@ -2126,6 +2134,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_pdp_act_par;
 	case STK_DATA_OBJECT_TYPE_ITEM_TEXT_ATTRIBUTE_LIST:
 		return parse_dataobj_item_text_attribute_list;
+	case STK_DATA_OBJECT_TYPE_UTRAN_MEASUREMENT_QUALIFIER:
+		return parse_dataobj_utran_meas_qualifier;
 	case STK_DATA_OBJECT_TYPE_IMEISV:
 		return parse_dataobj_imeisv;
 	case STK_DATA_OBJECT_TYPE_NETWORK_SEARCH_MODE:
diff --git a/src/stkutil.h b/src/stkutil.h
index c6c1af0..4efb1d9 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -164,6 +164,7 @@ enum stk_data_object_type {
 	STK_DATA_OBJECT_TYPE_FRAME_LAYOUT =			0x66,
 	STK_DATA_OBJECT_TYPE_FRAMES_INFO =			0x67,
 	STK_DATA_OBJECT_TYPE_FRAME_ID =				0x68,
+	STK_DATA_OBJECT_TYPE_UTRAN_MEASUREMENT_QUALIFIER =	0x69,
 	STK_DATA_OBJECT_TYPE_MMS_REFERENCE =			0x6A,
 	STK_DATA_OBJECT_TYPE_MMS_ID =				0x6B,
 	STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS =		0x6C,
-- 
1.7.0.4


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

* Re: [PATCH 01/12] stk: Add parser for send ss commands
  2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
                   ` (10 preceding siblings ...)
  2010-06-13  9:43 ` [PATCH 12/12] stk: Add parser for UTRAN meas qualifier objects Yang Gu
@ 2010-06-16 22:42 ` Denis Kenzior
  11 siblings, 0 replies; 23+ messages in thread
From: Denis Kenzior @ 2010-06-16 22:42 UTC (permalink / raw)
  To: ofono

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

Hi Yang,

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

Patches 1-2, 7-9 and 11-12 in this series have been applied.  For others, 
please see individual comments and rebase/resubmit.

Regards,
-Denis

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

* Re: [PATCH 03/12] stk: Add parser for send ussd commands
  2010-06-13  9:43 ` [PATCH 03/12] stk: Add parser for send ussd commands Yang Gu
@ 2010-06-16 22:44   ` Denis Kenzior
  0 siblings, 0 replies; 23+ messages in thread
From: Denis Kenzior @ 2010-06-16 22:44 UTC (permalink / raw)
  To: ofono

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

Hi Yang,

> +char *ussd_decode(int dcs, int len, const unsigned char *data);
> 

Please put this function in smsutil.c/h, no need to start a brand new file for 
this.  It is highly related to sms / cbs anyway.

Regards,
-Denis

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

* Re: [PATCH 05/12] Modify ussd parser
  2010-06-13  9:43 ` [PATCH 05/12] Modify " Yang Gu
@ 2010-06-16 22:48   ` Denis Kenzior
  2010-06-17 10:33     ` Gu, Yang
  0 siblings, 1 reply; 23+ messages in thread
From: Denis Kenzior @ 2010-06-16 22:48 UTC (permalink / raw)
  To: ofono

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

Hi Yang,

> * Original code doesn't call unpack_7bit(), which seems not correct.
> * An utility function is used to handle it, which supports 8-bit
> and ucs2 besides 7-bit character.
> * Status is assigned with correct value when error occurs

Please drop this patch for now, the problem is that all AT modems do not 
actually report USSD data as a PDU, instead they actually decode this into the 
current character set of the modem (as set by +CSCS.)  The spec really screwed 
up on this one.

This is one of the weirder parts of the spec, I don't think USSDs that are not 
GSM 7 bit are even possible.  At least not on the AT modems I've encountered.

Feel free to investigate this further.

Regards,
-Denis

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

* Re: [PATCH 06/12] Refactor ussd parser
  2010-06-13  9:43 ` [PATCH 06/12] Refactor " Yang Gu
@ 2010-06-16 22:49   ` Denis Kenzior
  2010-06-21 14:09     ` Aki Niemi
  2010-06-21 14:08   ` Aki Niemi
  1 sibling, 1 reply; 23+ messages in thread
From: Denis Kenzior @ 2010-06-16 22:49 UTC (permalink / raw)
  To: ofono

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

Aki,

> ---
>  drivers/isimodem/ussd.c |   36 +++++++-----------------------------
>  1 files changed, 7 insertions(+), 29 deletions(-)
> 

Please review this patch and comment on whether ISI modems can indeed support 
UCS2 / 8Bit data along with 7 bit packed GSM.

Regards,
-Denis

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

* Re: [PATCH 10/12] stk: Add parser for timing advance objects
  2010-06-13  9:43 ` [PATCH 10/12] stk: Add parser for timing advance objects Yang Gu
@ 2010-06-16 22:50   ` Denis Kenzior
  2010-06-16 23:19   ` andrzej zaborowski
  1 sibling, 0 replies; 23+ messages in thread
From: Denis Kenzior @ 2010-06-16 22:50 UTC (permalink / raw)
  To: ofono

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

Hi Yang,

> ---
>  src/stkutil.c       |   22 ++++++++++++++++++++++
>  src/stkutil.h       |   28 ++++++++++++++++++----------
>  unit/test-stkutil.c |    2 +-
>  3 files changed, 41 insertions(+), 11 deletions(-)

I think the patch is fine, but no longer applies.  Please rebase and resubmit 
this one.

Regards,
-Denis

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

* Re: [PATCH 10/12] stk: Add parser for timing advance objects
  2010-06-13  9:43 ` [PATCH 10/12] stk: Add parser for timing advance objects Yang Gu
  2010-06-16 22:50   ` Denis Kenzior
@ 2010-06-16 23:19   ` andrzej zaborowski
  2010-06-17  1:44     ` Gu, Yang
  1 sibling, 1 reply; 23+ messages in thread
From: andrzej zaborowski @ 2010-06-16 23:19 UTC (permalink / raw)
  To: ofono

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

Hi,

On 13 June 2010 11:43, Yang Gu <yang.gu@intel.com> wrote:
> +enum stk_me_status {
> +       STK_ME_STATUS_IDLE =            0x00,
> +       STK_ME_STATUS_NOT_IDLE =        0x01
> +};
> +
>  /* For data object that only has a byte array with undetermined length */
>  struct stk_common_byte_array {
>        unsigned char *array;
> @@ -671,6 +676,18 @@ struct stk_timer_value {
>        unsigned char second;
>  };
>
> +/* Defined in TS 31.111 Section 8.46 */
> +struct stk_timing_advance {
> +       ofono_bool_t has_value;
> +       unsigned char status;

Why change the status to char here?  I think using an enum here is
nicer because it gives a hint to users about what values are expected
and the compiler can emit warnings if needed.

Regards

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

* RE: [PATCH 10/12] stk: Add parser for timing advance objects
  2010-06-16 23:19   ` andrzej zaborowski
@ 2010-06-17  1:44     ` Gu, Yang
  0 siblings, 0 replies; 23+ messages in thread
From: Gu, Yang @ 2010-06-17  1:44 UTC (permalink / raw)
  To: ofono

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

Hi Andrew,

>-----Original Message-----
>From: ofono-bounces(a)ofono.org [mailto:ofono-bounces(a)ofono.org] On Behalf Of
>andrzej zaborowski
>Sent: Thursday, June 17, 2010 7:19 AM
>To: ofono(a)ofono.org
>Subject: Re: [PATCH 10/12] stk: Add parser for timing advance objects
>
>Hi,
>
>On 13 June 2010 11:43, Yang Gu <yang.gu@intel.com> wrote:
>> +enum stk_me_status {
>> +       STK_ME_STATUS_IDLE =            0x00,
>> +       STK_ME_STATUS_NOT_IDLE =        0x01
>> +};
>> +
>>  /* For data object that only has a byte array with undetermined length */
>>  struct stk_common_byte_array {
>>        unsigned char *array;
>> @@ -671,6 +676,18 @@ struct stk_timer_value {
>>        unsigned char second;
>>  };
>>
>> +/* Defined in TS 31.111 Section 8.46 */
>> +struct stk_timing_advance {
>> +       ofono_bool_t has_value;
>> +       unsigned char status;
>
>Why change the status to char here?  I think using an enum here is
>nicer because it gives a hint to users about what values are expected
>and the compiler can emit warnings if needed.

Agree and I will change this to enum. 

>
>Regards
>_______________________________________________
>ofono mailing list
>ofono(a)ofono.org
>http://lists.ofono.org/listinfo/ofono

Regards,
-Yang

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

* Re: [PATCH 05/12] Modify ussd parser
  2010-06-17 10:33     ` Gu, Yang
@ 2010-06-17  9:35       ` Denis Kenzior
  0 siblings, 0 replies; 23+ messages in thread
From: Denis Kenzior @ 2010-06-17  9:35 UTC (permalink / raw)
  To: ofono

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

Hi Yang,

> >Please drop this patch for now, the problem is that all AT modems do not
> >actually report USSD data as a PDU, instead they actually decode this into
> > the current character set of the modem (as set by +CSCS.)  The spec
> > really screwed up on this one.
> >
> >This is one of the weirder parts of the spec, I don't think USSDs that are
> > not GSM 7 bit are even possible.  At least not on the AT modems I've
> > encountered.
> 
> When it's GSM 7-bit, is it needed to call unpack_7bit() before calling
>  convert_gsm_to_utf8()? The isimodem does so. Also the status doesn't have

Again, the AT modems do not pass in a raw PDU here unlike isi modems.  They 
just give you the string in whatever the character set is set with +CSCS.  If 
it happens to be UTF8, it will be UTF8.  If it happens to be GSM, it'll be 
GSM.  The current driver just assumes GSM, however we really need to know the 
character set.  Generally this works out because the characters are ASCII, but 
the current driver does not work in all situations.

>  an initial value, so in some path of code status would have an uncertain
>  value, which may cause problem when calling ofono_ussd_notify(). Maybe the

I don't see any issue, from what I can tell status is always set appropriately 
before calling ussd_notify.  Can you be more specific about your concern here?

Regards,
-Denis

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

* RE: [PATCH 05/12] Modify ussd parser
  2010-06-16 22:48   ` Denis Kenzior
@ 2010-06-17 10:33     ` Gu, Yang
  2010-06-17  9:35       ` Denis Kenzior
  0 siblings, 1 reply; 23+ messages in thread
From: Gu, Yang @ 2010-06-17 10:33 UTC (permalink / raw)
  To: ofono

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

Hi Denis,



>-----Original Message-----
>From: Denis Kenzior [mailto:denkenz(a)gmail.com]
>Sent: Thursday, June 17, 2010 6:48 AM
>To: ofono(a)ofono.org
>Cc: Gu, Yang
>Subject: Re: [PATCH 05/12] Modify ussd parser
>
>Hi Yang,
>
>> * Original code doesn't call unpack_7bit(), which seems not correct.
>> * An utility function is used to handle it, which supports 8-bit
>> and ucs2 besides 7-bit character.
>> * Status is assigned with correct value when error occurs
>
>Please drop this patch for now, the problem is that all AT modems do not
>actually report USSD data as a PDU, instead they actually decode this into the
>current character set of the modem (as set by +CSCS.)  The spec really screwed
>up on this one.
>
>This is one of the weirder parts of the spec, I don't think USSDs that are not
>GSM 7 bit are even possible.  At least not on the AT modems I've encountered.

When it's GSM 7-bit, is it needed to call unpack_7bit() before calling convert_gsm_to_utf8()? The isimodem does so.
Also the status doesn't have an initial value, so in some path of code status would have an uncertain value, which may cause problem when calling ofono_ussd_notify(). Maybe the situation is it's always GSM 7-bit, but the code shouldn't seem buggy. 
I will still include these changes in my new patches, feel free to comment them or even ignore them.

>
>Feel free to investigate this further.
>
>Regards,
>-Denis

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

* Re: [PATCH 06/12] Refactor ussd parser
  2010-06-13  9:43 ` [PATCH 06/12] Refactor " Yang Gu
  2010-06-16 22:49   ` Denis Kenzior
@ 2010-06-21 14:08   ` Aki Niemi
  1 sibling, 0 replies; 23+ messages in thread
From: Aki Niemi @ 2010-06-21 14:08 UTC (permalink / raw)
  To: ofono

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

On Sun, 2010-06-13 at 11:43 +0200, ext Yang Gu wrote:
> ---
>  drivers/isimodem/ussd.c |   36 +++++++-----------------------------
>  1 files changed, 7 insertions(+), 29 deletions(-)

Looks good.

Cheers,
Aki


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

* Re: [PATCH 06/12] Refactor ussd parser
  2010-06-16 22:49   ` Denis Kenzior
@ 2010-06-21 14:09     ` Aki Niemi
  0 siblings, 0 replies; 23+ messages in thread
From: Aki Niemi @ 2010-06-21 14:09 UTC (permalink / raw)
  To: ofono

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

On Thu, 2010-06-17 at 00:49 +0200, ext Denis Kenzior wrote:
> Aki,
> 
> > ---
> >  drivers/isimodem/ussd.c |   36 +++++++-----------------------------
> >  1 files changed, 7 insertions(+), 29 deletions(-)
> > 
> 
> Please review this patch and comment on whether ISI modems can indeed support 
> UCS2 / 8Bit data along with 7 bit packed GSM.

ISI modems do support both GSM 7bit and UCS-2 in USSD, as the DCS field
is sent along with the USSD string.

Cheers,
Aki


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

end of thread, other threads:[~2010-06-21 14:09 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-13  9:43 [PATCH 01/12] stk: Add parser for send ss commands Yang Gu
2010-06-13  9:43 ` [PATCH 02/12] teststk: Add test for send ss parser Yang Gu
2010-06-13  9:43 ` [PATCH 03/12] stk: Add parser for send ussd commands Yang Gu
2010-06-16 22:44   ` Denis Kenzior
2010-06-13  9:43 ` [PATCH 04/12] teststk: Add test for send ussd parser Yang Gu
2010-06-13  9:43 ` [PATCH 05/12] Modify " Yang Gu
2010-06-16 22:48   ` Denis Kenzior
2010-06-17 10:33     ` Gu, Yang
2010-06-17  9:35       ` Denis Kenzior
2010-06-13  9:43 ` [PATCH 06/12] Refactor " Yang Gu
2010-06-16 22:49   ` Denis Kenzior
2010-06-21 14:09     ` Aki Niemi
2010-06-21 14:08   ` Aki Niemi
2010-06-13  9:43 ` [PATCH 07/12] Add several proactive command parsers Yang Gu
2010-06-13  9:43 ` [PATCH 08/12] stk: Add parser for cell broadcast page objects Yang Gu
2010-06-13  9:43 ` [PATCH 09/12] stk: Add parser for bcch channel list objects Yang Gu
2010-06-13  9:43 ` [PATCH 10/12] stk: Add parser for timing advance objects Yang Gu
2010-06-16 22:50   ` Denis Kenzior
2010-06-16 23:19   ` andrzej zaborowski
2010-06-17  1:44     ` Gu, Yang
2010-06-13  9:43 ` [PATCH 11/12] stk: Add parser for PDP activation param objects Yang Gu
2010-06-13  9:43 ` [PATCH 12/12] stk: Add parser for UTRAN meas qualifier objects Yang Gu
2010-06-16 22:42 ` [PATCH 01/12] stk: Add parser for send ss commands Denis Kenzior

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.