Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/8] stk: Add parser for setup idle mode text commands
@ 2010-05-19 10:24 Yang Gu
  2010-05-19 10:24 ` [PATCH 2/8] test-stk: Add test for setup idle mode text parser Yang Gu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-19 10:24 UTC (permalink / raw)
  To: ofono

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

---
 src/stkutil.c |   40 ++++++++++++++++++++++++++++++++++++++++
 src/stkutil.h |    8 ++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index e053e2c..3b1e957 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2710,6 +2710,43 @@ static gboolean parse_timer_mgmt(struct stk_command *command,
 	return TRUE;
 }
 
+static void destroy_setup_idle_mode_text(struct stk_command *command)
+{
+	g_free(command->setup_idle_mode_text.text);
+}
+
+static gboolean parse_setup_idle_mode_text(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_setup_idle_mode_text *obj =
+					&command->setup_idle_mode_text;
+	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_TEXT,
+				DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+				&obj->text,
+				STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+				&obj->icon_id,
+				STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+				&obj->text_attr,
+				STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+				&obj->frame_id,
+				STK_DATA_OBJECT_TYPE_INVALID);
+
+	if (ret == FALSE)
+		return FALSE;
+
+	command->destructor = destroy_setup_idle_mode_text;
+
+	return TRUE;
+}
+
 struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 						unsigned int len)
 {
@@ -2825,6 +2862,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_TIMER_MANAGEMENT:
 		ok = parse_timer_mgmt(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT:
+		ok = parse_setup_idle_mode_text(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 4adbe6b..09e5731 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -965,6 +965,13 @@ struct stk_command_timer_mgmt {
 	struct stk_timer_value timer_value;
 };
 
+struct stk_command_setup_idle_mode_text {
+	char *text;
+	struct stk_icon_id icon_id;
+	struct stk_text_attribute text_attr;
+	struct stk_frame_id frame_id;
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -986,6 +993,7 @@ struct stk_command {
 		struct stk_command_setup_event_list setup_event_list;
 		struct stk_command_perform_card_apdu perform_card_apdu;
 		struct stk_command_timer_mgmt timer_mgmt;
+		struct stk_command_setup_idle_mode_text setup_idle_mode_text;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4


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

end of thread, other threads:[~2010-05-25 22:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 10:24 [PATCH 1/8] stk: Add parser for setup idle mode text commands Yang Gu
2010-05-19 10:24 ` [PATCH 2/8] test-stk: Add test for setup idle mode text parser Yang Gu
2010-05-19 10:24 ` [PATCH 3/8] stk: Add parser for run at command commands Yang Gu
2010-05-19 10:24 ` [PATCH 4/8] test-stk: Add test for run at command parser Yang Gu
2010-05-19 10:24 ` [PATCH 5/8] stk: Add parser for send dtmf commands Yang Gu
2010-05-19 10:24 ` [PATCH 6/8] test-stk: Add test for send dtmf parser Yang Gu
2010-05-19 10:24 ` [PATCH 7/8] stk: Add parser for language notification commands Yang Gu
2010-05-19 10:24 ` [PATCH 8/8] teststk: Add test for language notification parser Yang Gu
2010-05-25 22:56 ` [PATCH 1/8] stk: Add parser for setup idle mode text commands Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox