All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] stk: Handle provide local info proactive command
Date: Fri, 26 Nov 2010 14:49:21 -0600	[thread overview]
Message-ID: <4CF01D51.4050102@gmail.com> (raw)
In-Reply-To: <1290688142-14726-3-git-send-email-yang.gu@intel.com>

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

Hi Yang,

On 11/25/2010 06:29 AM, Yang Gu wrote:
> ---
>  src/smsutil.c  |    6 +-

Please send patches against smsutil separately.

>  src/stk.c      |  113 +++++++++++++++++++++++++++++++++++++++++
>  src/stkagent.c |  153 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  src/stkagent.h |   14 +++++
>  src/stkutil.c  |    2 +-

Same goes for stkutil

>  5 files changed, 284 insertions(+), 4 deletions(-)
> 
> diff --git a/src/smsutil.c b/src/smsutil.c
> index e6dbf5f..5394817 100644
> --- a/src/smsutil.c
> +++ b/src/smsutil.c
> @@ -324,10 +324,10 @@ gboolean sms_encode_scts(const struct sms_scts *in, unsigned char *pdu,
>  	if (in->year > 99)
>  		return FALSE;
>  
> -	if (in->month > 12)
> +	if (in->month > 12 || in->month == 0)
>  		return FALSE;
>  
> -	if (in->day > 31)
> +	if (in->day > 31 || in->day == 0)
>  		return FALSE;
>  
>  	if (in->hour > 23)
> @@ -339,7 +339,7 @@ gboolean sms_encode_scts(const struct sms_scts *in, unsigned char *pdu,
>  	if (in->second > 59)
>  		return FALSE;
>  
> -	if ((in->timezone > 12*4-1) || (in->timezone < -(12*4-1)))
> +	if ((in->timezone > 12*4) || (in->timezone < -(12*4-1)))

Err, why would +48 be valid?

<snip>

> diff --git a/src/stkagent.c b/src/stkagent.c
> index 5cf83e4..78620d5 100644
> --- a/src/stkagent.c
> +++ b/src/stkagent.c
> @@ -956,3 +956,156 @@ int stk_agent_loop_tone(struct stk_agent *agent, const char *text,
>  
>  	return 0;
>  }
> +int stk_agent_request_time(struct stk_agent *agent, stk_agent_time_cb cb,
> +				void *user_data, ofono_destroy_func destroy,
> +				int timeout)

So I really don't think we need an agent for this one.  Just having
oFono grab the time and return the info should be enough.


<snip>

> +int stk_agent_request_lang(struct stk_agent *agent, stk_agent_string_cb cb,
> +				void *user_data, ofono_destroy_func destroy,
> +				int timeout)
> +{

I'm not an expert on i18n, but this seems to be something oFono can
handle internally.  Perhaps querying the LANG environment variable or
something?

<snip>

> diff --git a/src/stkutil.c b/src/stkutil.c
> index 377ceff..48ce93b 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -4553,7 +4553,7 @@ static gboolean build_dataobj_datetime_timezone(struct stk_tlv_builder *tlv,
>  		return TRUE;
>  
>  	/* Time zone information is optional */
> -	if (scts->timezone == (gint8) 0xff) {
> +	if (scts->timezone == -48) {
>  		memcpy(&timestamp, scts, sizeof(timestamp));
>  		timestamp.timezone = 0;
>  		if (sms_encode_scts(&timestamp, value, &offset) != TRUE)

As mentioned previously, my vote is for has_tz here.

Regards,
-Denis

  parent reply	other threads:[~2010-11-26 20:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 12:28 [PATCH 0/3] Patch Description Yang Gu
2010-11-25 12:29 ` [PATCH 1/3] network: Use bit as size instead of byte Yang Gu
2010-11-26 20:02   ` Denis Kenzior
2010-11-25 12:29 ` [PATCH 2/3] stk: Handle provide local info proactive command Yang Gu
2010-11-25 23:36   ` andrzej zaborowski
2010-11-26 20:49   ` Denis Kenzior [this message]
2010-11-29  2:47     ` Gu, Yang
2010-11-29 13:47       ` Denis Kenzior
2010-11-25 12:29 ` [PATCH 3/3] test-stk: Add provide local info Yang Gu
2010-11-25 23:25 ` [PATCH 0/3] Patch Description andrzej zaborowski
2010-11-26  3:29   ` Gu, Yang
2010-11-26 20:44   ` 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=4CF01D51.4050102@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.