From: Yang Gu <gyagp0@gmail.com>
To: ofono@ofono.org
Subject: [PATCH 3/3] Interpret "" Alpha Id as empty data object
Date: Fri, 09 Jul 2010 22:52:08 +0800 [thread overview]
Message-ID: <1278687128-8983-3-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1278687128-8983-1-git-send-email-yang.gu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3830 bytes --]
There needs to be a way to distinguish between no alphaid and "empty
data object" because on some occasions they have different meanings. In
the Call Control envelope, no Alpha Identifier means the terminal can
inform the user about the call being modified by SIM while empty data
object means no hint should be given.
---
src/stkutil.c | 4 +++-
unit/test-stkutil.c | 18 ++++++++++++++----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 94ff182..c45f985 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -297,8 +297,10 @@ static gboolean parse_dataobj_alpha_id(struct comprehension_tlv_iter *iter,
char *utf8;
len = comprehension_tlv_iter_get_length(iter);
- if (len == 0)
+ if (len == 0) {
+ *alpha_id = g_try_malloc0(1);
return TRUE;
+ }
data = comprehension_tlv_iter_get_data(iter);
utf8 = sim_string_to_utf8(data, len);
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 0b95265..dbd5b5e 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -4974,7 +4974,8 @@ static struct setup_menu_test setup_menu_data_112 = {
static struct setup_menu_test setup_menu_data_113 = {
.pdu = setup_menu_113,
.pdu_len = sizeof(setup_menu_113),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = ""
};
static struct setup_menu_test setup_menu_data_121 = {
@@ -5442,7 +5443,8 @@ static struct setup_menu_test setup_menu_data_712 = {
static struct setup_menu_test setup_menu_data_713 = {
.pdu = setup_menu_713,
.pdu_len = sizeof(setup_menu_713),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = ""
};
static struct setup_menu_test setup_menu_data_811 = {
@@ -5472,7 +5474,8 @@ static struct setup_menu_test setup_menu_data_812 = {
static struct setup_menu_test setup_menu_data_813 = {
.pdu = setup_menu_813,
.pdu_len = sizeof(setup_menu_813),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = ""
};
static struct setup_menu_test setup_menu_data_911 = {
@@ -5502,7 +5505,8 @@ static struct setup_menu_test setup_menu_data_912 = {
static struct setup_menu_test setup_menu_data_913 = {
.pdu = setup_menu_913,
.pdu_len = sizeof(setup_menu_913),
- .qualifier = 0x00
+ .qualifier = 0x00,
+ .alpha_id = ""
};
static struct setup_menu_test setup_menu_data_neg_1 = {
@@ -7957,6 +7961,7 @@ static struct send_sms_test send_sms_data_171 = {
.pdu = send_sms_171,
.pdu_len = sizeof(send_sms_171),
.qualifier = 0x00,
+ .alpha_id = "",
.gsm_sms = {
{
.number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
@@ -9474,6 +9479,7 @@ static struct send_ss_test send_ss_data_161 = {
.pdu = send_ss_161,
.pdu_len = sizeof(send_ss_161),
.qualifier = 0x00,
+ .alpha_id = "",
.ss = {
.ton_npi = 0x91,
.ss = "**21*01234567890123456789*10#"
@@ -10774,6 +10780,7 @@ static struct send_ussd_test send_ussd_data_181 = {
.pdu = send_ussd_181,
.pdu_len = sizeof(send_ussd_181),
.qualifier = 0x00,
+ .alpha_id = "",
.ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
"1234567890"
};
@@ -14621,6 +14628,7 @@ static struct run_at_command_test run_at_command_data_121 = {
.pdu = run_at_command_121,
.pdu_len = sizeof(run_at_command_121),
.qualifier = 0x00,
+ .alpha_id = "",
.at_command = "AT+CGMI"
};
@@ -15319,6 +15327,7 @@ static struct send_dtmf_test send_dtmf_data_131 = {
.pdu = send_dtmf_131,
.pdu_len = sizeof(send_dtmf_131),
.qualifier = 0x00,
+ .alpha_id = "",
.dtmf = "1cccccccccc2"
};
@@ -16039,6 +16048,7 @@ static struct launch_browser_test launch_browser_data_121 = {
.pdu = launch_browser_121,
.pdu_len = sizeof(launch_browser_121),
.qualifier = 0x00,
+ .alpha_id = "",
.url = "http://xxx.yyy.zzz"
};
--
1.7.0.4
next prev parent reply other threads:[~2010-07-09 14:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-09 14:52 [PATCH 1/3] Make fetch command function as external Yang Gu
2010-07-09 14:52 ` [PATCH 2/3] Support phonesim proactive command notification Yang Gu
2010-07-09 17:18 ` Denis Kenzior
2010-07-09 14:52 ` Yang Gu [this message]
2010-07-09 15:22 ` [PATCH 3/3] Interpret "" Alpha Id as empty data object Gu, Yang
2010-07-09 17:32 ` Denis Kenzior
2010-07-11 13:59 ` Gu, Yang
2010-07-09 15:09 ` [PATCH 1/3] Make fetch command function as external Gu, Yang
2010-07-09 17:17 ` 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=1278687128-8983-3-git-send-email-yang.gu@intel.com \
--to=gyagp0@gmail.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