Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 5/6] Add parser for imei objects
Date: Wed, 24 Mar 2010 12:38:36 -0500	[thread overview]
Message-ID: <201003241238.37128.denkenz@gmail.com> (raw)
In-Reply-To: <1269423347-15508-5-git-send-email-yang.gu@intel.com>

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

Hi Yang,

> ---
>  src/stkutil.c |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/src/stkutil.c b/src/stkutil.c
> index a6b0284..3e423b5 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -549,6 +549,28 @@ static gboolean parse_dataobj_location_info(
>  	return TRUE;
>  }
> 
> +/* Defined in TS 102.223 Section 8.20 */
> +static gboolean parse_dataobj_imei(struct comprehension_tlv_iter *iter,
> +						void *user)
> +{
> +	char **imei = user;

So this one implies character data (e.g. string), but...

> +	const unsigned char *data;
> +	unsigned int len;
> +
> +	if (comprehension_tlv_iter_get_tag(iter) !=
> +			STK_DATA_OBJECT_TYPE_IMEI)
> +		return FALSE;
> +
> +	len = comprehension_tlv_iter_get_length(iter);
> +	if (len != 8)
> +		return FALSE;
> +
> +	data = comprehension_tlv_iter_get_data(iter);
> +	memcpy(*imei, data, len);

Here you copy binary data into a string array.  Since IMEI is essentially bcd 
encoded I suggest you parse it into string form here.

> +
> +	return TRUE;
> +}
> +

Regards,
-Denis

  parent reply	other threads:[~2010-03-24 17:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24  9:35 [PATCH 1/6] Add parser for location information objects Yang Gu
2010-03-24  9:35 ` [PATCH 2/6] Add macro for ber-tlv more time Yang Gu
2010-03-24  9:35   ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Yang Gu
2010-03-24  9:35     ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Yang Gu
2010-03-24  9:35       ` [PATCH 5/6] Add parser for imei objects Yang Gu
2010-03-24  9:35         ` [PATCH 6/6] Add parser for help request objects Yang Gu
2010-03-24 17:44           ` Denis Kenzior
2010-03-24 17:38         ` Denis Kenzior [this message]
2010-03-24 17:15       ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Denis Kenzior
2010-03-24 17:03     ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Denis Kenzior
2010-03-24 17:15   ` [PATCH 2/6] Add macro for ber-tlv more time Denis Kenzior
2010-03-24 20:00 ` [PATCH 1/6] Add parser for location information objects 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=201003241238.37128.denkenz@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