[PATCH 7/8] stk: Add parser for language notification commands

Yang Gu yang.gu at intel.com
Wed May 19 03:24:45 PDT 2010


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

diff --git a/src/stkutil.c b/src/stkutil.c
index c0242cd..62b25e8 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2825,6 +2825,29 @@ static gboolean parse_send_dtmf(struct stk_command *command,
 	return TRUE;
 }
 
+static gboolean parse_language_notification(struct stk_command *command,
+					struct comprehension_tlv_iter *iter)
+{
+	struct stk_command_language_notification *obj =
+					&command->language_notification;
+	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_LANGUAGE, 0,
+				&obj->language,
+				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)
 {
@@ -2949,6 +2972,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
 	case STK_COMMAND_TYPE_SEND_DTMF:
 		ok = parse_send_dtmf(command, &iter);
 		break;
+	case STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION:
+		ok = parse_language_notification(command, &iter);
+		break;
 	default:
 		ok = FALSE;
 		break;
diff --git a/src/stkutil.h b/src/stkutil.h
index dcae839..b58c85c 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -988,6 +988,10 @@ struct stk_command_send_dtmf {
 	struct stk_frame_id frame_id;
 };
 
+struct stk_command_language_notification {
+	char language[3];
+};
+
 struct stk_command {
 	unsigned char number;
 	unsigned char type;
@@ -1012,6 +1016,7 @@ struct stk_command {
 		struct stk_command_setup_idle_mode_text setup_idle_mode_text;
 		struct stk_command_run_at_command run_at_command;
 		struct stk_command_send_dtmf send_dtmf;
+		struct stk_command_language_notification language_notification;
 	};
 
 	void (*destructor)(struct stk_command *command);
-- 
1.7.0.4



More information about the ofono mailing list