Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] atmodem: Do some polling on at_pin_query
Date: Thu, 12 Apr 2012 14:36:20 -0500	[thread overview]
Message-ID: <4F872EB4.60207@gmail.com> (raw)
In-Reply-To: <1334240913-27063-1-git-send-email-guillaume.zajac@linux.intel.com>

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

Hi Guillaume,

On 04/12/2012 09:28 AM, Guillaume Zajac wrote:
> For some modem like ZTE MF180/190, we need to do some
> polling to check SIM state when it returns +CME ERROR: 14 busy.
> ---
>  drivers/atmodem/sim.c |   59 +++++++++++++++++++++++++++++++++++++++---------
>  1 files changed, 48 insertions(+), 11 deletions(-)
> 

<snip>

> @@ -874,9 +878,22 @@ static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
>  	else
>  		decode_at_error(&error, final);
>  
> -	if (!ok) {
> +	switch (error.type) {
> +	case OFONO_ERROR_TYPE_NO_ERROR:
> +		break;
> +	case OFONO_ERROR_TYPE_CME:
> +		/* Check for SIM busy - try again later */
> +		if (error.error == 14) {
> +			if (sd->poll_count++ < 12) {
> +				sd->poll_source = g_timeout_add_seconds(2,
> +						sim_state_check, cbd);
> +				return;
> +			}
> +		}
> +		/* fall through */
> +	default:
>  		cb(&error, -1, cbd->data);
> -		return;
> +		goto done;
>  	}
>  
>  	if (sd->vendor == OFONO_VENDOR_WAVECOM) {

Is there a reason we are not using at_util_sim_state_query_new?

<snip>

Regards,
-Denis

  reply	other threads:[~2012-04-12 19:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 14:28 [PATCH] atmodem: Do some polling on at_pin_query Guillaume Zajac
2012-04-12 19:36 ` Denis Kenzior [this message]
2012-04-16  8:06   ` Guillaume Zajac
2012-04-16 14:15     ` Denis Kenzior
2012-04-17  7:52       ` Guillaume Zajac

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=4F872EB4.60207@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