From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 7/8] stk: Add parser for language notification commands
Date: Wed, 19 May 2010 18:24:45 +0800 [thread overview]
Message-ID: <1274264686-9706-7-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1274264686-9706-1-git-send-email-yang.gu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]
---
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
next prev parent reply other threads:[~2010-05-19 10:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Yang Gu [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274264686-9706-7-git-send-email-yang.gu@intel.com \
--to=yang.gu@intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox