Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 10/12] Add build_dataobj_ussd_text for ussd specific text string handling
Date: Thu, 09 Sep 2010 10:31:10 -0500	[thread overview]
Message-ID: <4C88FDBE.70706@gmail.com> (raw)
In-Reply-To: <1284035516-21359-11-git-send-email-jeevaka.badrappan@elektrobit.com>

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

Hi Jeevaka,

On 09/09/2010 07:31 AM, Jeevaka Badrappan wrote:
> ---
>  src/stkutil.c |   35 +++++++++++++++++++++++++++++++++++
>  1 files changed, 35 insertions(+), 0 deletions(-)
> 
> diff --git a/src/stkutil.c b/src/stkutil.c
> index ae4cc32..e953ead 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -4170,6 +4170,34 @@ static gboolean build_dataobj_text(struct stk_tlv_builder *tlv,
>  	return stk_tlv_builder_close_container(tlv);
>  }
>  
> +/* Defined in TS 102.223 Section 8.15 - USSD specific case*/
> +static gboolean build_dataobj_ussd_text(struct stk_tlv_builder *tlv,
> +					const void *data, gboolean cr)
> +{
> +	const struct stk_ussd_text *text = data;
> +	unsigned char tag = STK_DATA_OBJECT_TYPE_TEXT;
> +	gboolean ret;
> +
> +	if (!text->text || !text->len)
> +		return TRUE;

You have to be a bit careful here.  Text does support the notion of
NULL/empty strings.  E.g. the CTLV is present, and the length is set to
0.  Refer to ETSI 102.223 Section 8.15.

> +
> +	if (stk_tlv_builder_open_container(tlv, cr, tag, TRUE) != TRUE)
> +		return FALSE;
> +
> +	if (text->dcs != -1) {
> +		if (stk_tlv_builder_append_byte(tlv, text->dcs) != TRUE)
> +			return FALSE;
> +		
> +		ret = stk_tlv_builder_append_bytes(tlv, text->text, text->len);
> +	} else
> +		ret = stk_tlv_builder_append_text(tlv, -1, (const char *) text->text);

I prefer that we assume dcs will always be 0x00, 0x04 or 0x08.

> +
> +	if (ret != TRUE)
> +		return ret;
> +
> +	return stk_tlv_builder_close_container(tlv);
> +}
> +
>  /* Described in TS 131.111 Section 8.17 */
>  static gboolean build_dataobj_ussd_string(struct stk_tlv_builder *tlv,
>  					const void *data, gboolean cr)
> @@ -5459,6 +5487,13 @@ const unsigned char *stk_pdu_from_response(const struct stk_response *response,
>  	case STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION:
>  	case STK_COMMAND_TYPE_LAUNCH_BROWSER:
>  		break;
> +	case STK_COMMAND_TYPE_SEND_USSD:
> +		ok = build_dataobj(&builder,
> +					build_dataobj_ussd_text,
> +					DATAOBJ_FLAG_CR,
> +					&response->send_ussd.text,
> +					NULL);
> +		break;
>  	default:
>  		return NULL;
>  	};

Regards,
-Denis

  reply	other threads:[~2010-09-09 15:31 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 12:31 Add support for Send USSD proactive command handling Jeevaka Badrappan
2010-09-09 12:31 ` [PATCH 01/12] atutil changes for parsing cscs query and cscs support Jeevaka Badrappan
2010-09-09 14:45   ` Denis Kenzior
2010-09-09 18:56     ` Jeevaka Badrappan
2010-09-09 18:56       ` [PATCH 01/13] " Jeevaka Badrappan
2010-09-10 17:27         ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 02/12] atgen changes for setting TE character set Jeevaka Badrappan
2010-09-09 14:50   ` Denis Kenzior
2010-09-09 19:00     ` [PATCH 02/13] " Jeevaka Badrappan
2010-09-09 12:31 ` [PATCH 03/12] phonesim " Jeevaka Badrappan
2010-09-09 19:01   ` [PATCH 03/13] " Jeevaka Badrappan
2010-09-10 17:07     ` Denis Kenzior
2010-09-10 20:29       ` [PATCH 2/7] " Jeevaka Badrappan
2010-09-09 12:31 ` [PATCH 04/12] USSD atom driver changes to read current character setting Jeevaka Badrappan
2010-09-09 19:02   ` [PATCH 04/13] " Jeevaka Badrappan
2010-09-09 12:31 ` [PATCH 05/12] Add internal api __ofono_call_barring_is_busy Jeevaka Badrappan
2010-09-09 15:06   ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 06/12] Add internal api __ofono_call_forwarding_is_busy Jeevaka Badrappan
2010-09-09 15:07   ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 07/12] Add internal api __ofono_call_settings_is_busy Jeevaka Badrappan
2010-09-09 15:07   ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 08/12] Add Send USSD command specific result codes Jeevaka Badrappan
2010-09-09 15:09   ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 09/12] Add Send USSD terminal response data structures Jeevaka Badrappan
2010-09-09 15:20   ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 10/12] Add build_dataobj_ussd_text for ussd specific text string handling Jeevaka Badrappan
2010-09-09 15:31   ` Denis Kenzior [this message]
2010-09-09 19:06     ` [PATCH 10/13] " Jeevaka Badrappan
2010-09-10 17:29       ` Denis Kenzior
2010-09-10 20:19         ` [PATCH 4/7] " Jeevaka Badrappan
2010-09-10 20:22           ` Denis Kenzior
2010-09-09 12:31 ` [PATCH 11/12] Internal and Driver api changes for Send USSD proactive command Jeevaka Badrappan
2010-09-09 15:59   ` Denis Kenzior
2010-09-09 20:25     ` [PATCH 6/8] " Jeevaka Badrappan
2010-09-09 20:25       ` [PATCH 7/8] Add __ofono_ussd_initiate internal api for Sending USSD Jeevaka Badrappan
2010-09-09 12:31 ` [PATCH 12/12] Handling of Send USSD proactive command Jeevaka Badrappan
2010-09-09 15:37   ` Denis Kenzior
2010-09-09 19:42     ` [PATCH 8/8] " Jeevaka Badrappan
2010-09-13 23:00 ` Added UCS2 handling and review comments incorporated Jeevaka Badrappan
2010-09-13 23:00   ` [PATCH 1/8] smsutil: Add USSD encoding function Jeevaka Badrappan
2010-09-13 23:00     ` [PATCH 2/8] util: Add UCS2 to GSM 7bit converion function Jeevaka Badrappan
2010-09-13 23:00       ` [PATCH 3/8] test-util: Add function for validating UCS2 to GSM bit conversion Jeevaka Badrappan
2010-09-13 23:00         ` [PATCH 4/8] USSD atom driver changes to read current character setting Jeevaka Badrappan
2010-09-13 23:00           ` [PATCH 5/8] Internal and Driver API changes for Send USSD Jeevaka Badrappan
2010-09-13 23:00             ` [PATCH 6/8] Add __ofono_ussd_initiate internal api for Sending USSD Jeevaka Badrappan
2010-09-13 23:00               ` [PATCH 7/8] stk: Handling of Send USSD proactive command Jeevaka Badrappan
2010-09-13 23:00                 ` [PATCH 8/8] stkutil: Add handling of error case scenario in build USSD data object Jeevaka Badrappan
2010-09-14 21:49                 ` [PATCH 3/4] stk: Handling of Send USSD proactive command Jeevaka Badrappan
2010-09-15 17:15                   ` Denis Kenzior
2010-09-14 17:45               ` [PATCH 6/8] Add __ofono_ussd_initiate internal api for Sending USSD Denis Kenzior
2010-09-14 21:31                 ` [PATCH 2/4] " Jeevaka Badrappan
2010-09-15 17:13                   ` Denis Kenzior
2010-09-14 17:24             ` [PATCH 5/8] Internal and Driver API changes for Send USSD Denis Kenzior
2010-09-14 21:23               ` [PATCH 1/4] " Jeevaka Badrappan
2010-09-15 17:13                 ` Denis Kenzior
2010-09-14 17:01           ` [PATCH 4/8] USSD atom driver changes to read current character setting Denis Kenzior
2010-09-14 17:01         ` [PATCH 3/8] test-util: Add function for validating UCS2 to GSM bit conversion Denis Kenzior
2010-09-14 17:01       ` [PATCH 2/8] util: Add UCS2 to GSM 7bit converion function Denis Kenzior
2010-09-14 16:58     ` [PATCH 1/8] smsutil: Add USSD encoding function 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=4C88FDBE.70706@gmail.com \
    --to=denkenz@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