Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v2 1/4] include: add method to query pin Retries
Date: Tue, 04 Jan 2011 11:11:04 -0600	[thread overview]
Message-ID: <4D2354A8.6020901@gmail.com> (raw)
In-Reply-To: <1294146379-30854-2-git-send-email-lucas.demarchi@profusion.mobi>

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

Hi Lucas,

On 01/04/2011 07:06 AM, Lucas De Marchi wrote:
> ---
>  include/sim.h |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/include/sim.h b/include/sim.h
> index 7860e24..bf4aaf9 100644
> --- a/include/sim.h
> +++ b/include/sim.h
> @@ -77,6 +77,11 @@ enum ofono_sim_state {
>  	OFONO_SIM_STATE_READY,
>  };
>  
> +struct ofono_sim_pin_retry {
> +	enum ofono_sim_password_type id;
> +	int val;
> +};
> +
>  typedef void (*ofono_sim_file_info_cb_t)(const struct ofono_error *error,
>  					int filelength,
>  					enum ofono_sim_file_structure structure,
> @@ -108,6 +113,10 @@ typedef void (*ofono_sim_passwd_cb_t)(const struct ofono_error *error,
>  					enum ofono_sim_password_type type,
>  					void *data);
>  
> +typedef void (*ofono_sim_pin_retries_cb_t)(const struct ofono_error *error,
> +						GSList *pin_retries,

One of the restrictions on the public ofono API is that we cannot use G*
types.  We can solve this in several ways:

- Use an array of ints with the size always being
OFONO_SIM_PASSWORD_INVALID.  The integer value contains the number of
retries or -1 if unknown / unsupported.

- Use an int length, struct ofono_sim_pin_retry *retries elements.  This
is similar to the approach taken in e.g. voicecall ofono_call_list_cb_t
or netreg ofono_netreg_operator_list_cb_t

> +						void *data);
> +
>  typedef void (*ofono_sim_lock_unlock_cb_t)(const struct ofono_error *error,
>  					void *data);
>  
> @@ -144,6 +153,8 @@ struct ofono_sim_driver {
>  			ofono_sim_passwd_cb_t cb, void *data);
>  	void (*send_passwd)(struct ofono_sim *sim, const char *passwd,
>  			ofono_sim_lock_unlock_cb_t cb, void *data);
> +	void (*query_pin_retries)(struct ofono_sim *sim,
> +				ofono_sim_pin_retries_cb_t cb, void *data);
>  	void (*reset_passwd)(struct ofono_sim *sim, const char *puk,
>  			const char *passwd,
>  			ofono_sim_lock_unlock_cb_t cb, void *data);

Regards,
-Denis

  reply	other threads:[~2011-01-04 17:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 13:06 [PATCH v2 0/4] Query retry counters Lucas De Marchi
2011-01-04 13:06 ` [PATCH v2 1/4] include: add method to query pin Retries Lucas De Marchi
2011-01-04 17:11   ` Denis Kenzior [this message]
2011-01-04 13:06 ` [PATCH v2 2/4] sim: query remaining pin retries Lucas De Marchi
2011-01-04 17:13   ` Denis Kenzior
2011-01-04 17:26     ` Lucas De Marchi
2011-01-04 17:29       ` Denis Kenzior
2011-01-04 13:06 ` [PATCH v2 3/4] doc: detail Retries property Lucas De Marchi
2011-01-04 13:06 ` [PATCH v2 4/4] atmodem: implement query for remaining pin retries Lucas De Marchi
2011-01-04 13:20 ` [PATCH v2 0/4] Query retry counters Sankar
2011-01-04 14:24   ` Lucas De Marchi

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=4D2354A8.6020901@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