From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 10/27] stkutil: Add setup call proactive command parser
Date: Thu, 13 May 2010 18:48:27 +0800 [thread overview]
Message-ID: <1273747724-28019-10-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1273747724-28019-1-git-send-email-yang.gu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3353 bytes --]
---
src/stkutil.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/stkutil.h | 15 +++++++++++++++
2 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 1b2297d..39278e7 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2501,6 +2501,58 @@ static gboolean parse_send_sms(struct stk_command *command,
return TRUE;
}
+static void destroy_setup_call(struct stk_command *command)
+{
+ g_free(command->setup_call.alpha_id_usr_cfm);
+ g_free(command->setup_call.addr.number);
+ g_free(command->setup_call.alpha_id_call_setup);
+}
+
+static gboolean parse_setup_call(struct stk_command *command,
+ struct comprehension_tlv_iter *iter)
+{
+ struct stk_command_setup_call *obj = &command->setup_call;
+ gboolean ret;
+
+ if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+ return FALSE;
+
+ if (command->dst != STK_DEVICE_IDENTITY_TYPE_NETWORK)
+ return FALSE;
+
+ ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+ &obj->alpha_id_usr_cfm,
+ STK_DATA_OBJECT_TYPE_ADDRESS,
+ DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+ &obj->addr,
+ STK_DATA_OBJECT_TYPE_CCP, 0,
+ &obj->ccp,
+ STK_DATA_OBJECT_TYPE_SUBADDRESS, 0,
+ &obj->subaddr,
+ STK_DATA_OBJECT_TYPE_DURATION, 0,
+ &obj->duration,
+ STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+ &obj->icon_id_usr_cfm,
+ STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+ &obj->alpha_id_call_setup,
+ STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+ &obj->icon_id_call_setup,
+ STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+ &obj->text_attr_usr_cfm,
+ STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+ &obj->text_attr_call_setup,
+ STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+ &obj->frame_id,
+ STK_DATA_OBJECT_TYPE_INVALID);
+
+ if (ret == FALSE)
+ return FALSE;
+
+ command->destructor = destroy_setup_call;
+
+ return TRUE;
+}
+
struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
unsigned int len)
{
@@ -2586,6 +2638,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
case STK_COMMAND_TYPE_SEND_SMS:
ok = parse_send_sms(command, &iter);
break;
+ case STK_COMMAND_TYPE_SETUP_CALL:
+ ok = parse_setup_call(command, &iter);
+ break;
default:
ok = FALSE;
break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 0c9fd50..d0d2486 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -860,6 +860,20 @@ struct stk_command_send_sms {
struct stk_frame_id frame_id;
};
+struct stk_command_setup_call {
+ char *alpha_id_usr_cfm;
+ struct stk_address addr;
+ struct stk_ccp ccp;
+ struct stk_subaddress subaddr;
+ struct stk_duration duration;
+ struct stk_icon_id icon_id_usr_cfm;
+ char *alpha_id_call_setup;
+ struct stk_icon_id icon_id_call_setup;
+ struct stk_text_attribute text_attr_usr_cfm;
+ struct stk_text_attribute text_attr_call_setup;
+ struct stk_frame_id frame_id;
+};
+
struct stk_command {
unsigned char number;
unsigned char type;
@@ -876,6 +890,7 @@ struct stk_command {
struct stk_command_setup_menu setup_menu;
struct stk_command_select_item select_item;
struct stk_command_send_sms send_sms;
+ struct stk_command_setup_call setup_call;
};
void (*destructor)(struct stk_command *command);
--
1.7.0.4
next prev parent reply other threads:[~2010-05-13 10:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-13 10:48 [PATCH 01/27] stk: Add poll interval proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 02/27] test-stkutil: Add test for poll interval parser Yang Gu
2010-05-13 10:48 ` [PATCH 03/27] stkutil: Add setup menu proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 04/27] test-stkutil: Add test for setup menu parser Yang Gu
2010-05-13 10:48 ` [PATCH 05/27] stkutil: Add select item proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 06/27] test-stkutil: Add test for select item parser Yang Gu
2010-05-13 10:48 ` [PATCH 07/27] test-stkutil: Use dedicated functions to check Yang Gu
2010-05-13 10:48 ` [PATCH 08/27] test-stkutil: Refactor test for send sms parser Yang Gu
2010-05-13 10:48 ` [PATCH 09/27] stk: Adjust the sequence of dataobj Yang Gu
2010-05-13 10:48 ` Yang Gu [this message]
2010-05-13 10:48 ` [PATCH 11/27] test-stkutil: Add unit test for setup call parser Yang Gu
2010-05-13 10:48 ` [PATCH 12/27] stkutil: Add refresh proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 13/27] test-stkutil: Add test for refresh parser Yang Gu
2010-05-13 10:48 ` [PATCH 14/27] stkutil: Add polling off proactive command parser Yang Gu
2010-05-13 10:48 ` [PATCH 15/27] test-stkutil: Add test for polling off parser Yang Gu
2010-05-13 10:48 ` [PATCH 16/27] stkutil: Add provide local info command parser Yang Gu
2010-05-13 10:48 ` [PATCH 17/27] test-stk: Add test for provide local info parser Yang Gu
2010-05-13 10:48 ` [PATCH 18/27] stkutil: Add event list command parser Yang Gu
2010-05-13 10:48 ` [PATCH 19/27] test-stkutil: Add test for event list parser Yang Gu
2010-05-13 10:48 ` [PATCH 20/27] stkutil: Add perform card apdu command parser Yang Gu
2010-05-13 10:48 ` [PATCH 21/27] test-stk: Add test for perform card apdu parser Yang Gu
2010-05-13 10:48 ` [PATCH 22/27] stkutil: Add power off card command parser Yang Gu
2010-05-13 10:48 ` [PATCH 23/27] stkutil: Add power on " Yang Gu
2010-05-13 10:48 ` [PATCH 24/27] stkutil: Add get reader status " Yang Gu
2010-05-13 10:48 ` [PATCH 25/27] test-stk: Add test for get reader status parser Yang Gu
2010-05-13 10:48 ` [PATCH 26/27] stkutil: Add timer management command parser Yang Gu
2010-05-13 10:48 ` [PATCH 27/27] test-stk: Add test for timer management parser Yang Gu
2010-05-13 20:37 ` [PATCH 01/27] stk: Add poll interval proactive command parser Denis Kenzior
2010-05-14 8:37 ` Gu, Yang
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=1273747724-28019-10-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