Re: [PATCH v4 1/8] core: Convert the pincode callback to an interable list.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alex,

On Fri, Apr 26, 2013, Alex Deymo wrote:
> The current pincode callback list on the adapter keeps track of all the
> pincode callbacks registered by a plugin for that adapter and calls each
> one until one provides a pincode for the current bonding. This mechanism
> forgets about what happened with previous bonding attempts and pushes the
> status track to the plugin side.
> 
> This patch creates an iterator struct (struct pincb_iter) that keeps track
> of the last function called and the number of times called. This will
> allow to provide more information about the bonding status to the pincode
> callback.
> ---
>  src/adapter.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++--------
>  src/adapter.h |  4 ++++
>  src/device.c  | 14 ++++++++++++++
>  src/device.h  |  1 +
>  4 files changed, 65 insertions(+), 8 deletions(-)
> 
> diff --git a/src/adapter.c b/src/adapter.c
> index 6255da6..f343178 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -121,6 +121,12 @@ struct service_auth {
>  	struct agent *agent;		/* NULL for queued auths */
>  };
>  
> +struct pincb_iter {

What concerns me a bit about this is that you're now introducing the
first symbols exported by adapter.{c.h} that are not name spaced with
btd_adapter* or adapter*. Would it make sense to keep this name spacing
even for the iterator?

> +	unsigned int attempt;		/* numer of times it() was called */

Just use int and not unsigned int. It's what we typically use for
iterator variables.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux