linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: Scott James Remnant <scott@netsplit.com>
Cc: linux-bluetooth@vger.kernel.org, keybuk@chromium.org,
	marcel@holtmann.org, hadess@hadess.net
Subject: Re: [PATCHv3 2/4] plugin: Add bonding callback support for plugins
Date: Thu, 5 Apr 2012 19:54:47 -0300	[thread overview]
Message-ID: <20120405225446.GA19517@samus> (raw)
In-Reply-To: <1333665653-30266-3-git-send-email-scott@netsplit.com>

Hi Scott,

On 15:40 Thu 05 Apr, Scott James Remnant wrote:
> Allow plugins to register a bonding callback on a device, this will be
> called on completion or cancellation of a bonding attempt on that
> device and allow retrying of the bonding attempt.
> 
> These callbacks will only be called once, in the case of retrying the
> callback must be registered again separately from another callback
> (e.g. the pincode callback).
> ---
>  src/device.c |   19 +++++++++++++++++++
>  src/device.h |    8 ++++++++
>  2 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/src/device.c b/src/device.c
> index feb330c..53ca977 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -147,6 +147,7 @@ struct btd_device {
>  	GSList		*primaries;		/* List of primary services */
>  	GSList		*drivers;		/* List of device drivers */
>  	GSList		*watches;		/* List of disconnect_data */
> +	GSList          *bonding_callbacks;	/* List of bonding callbacks */
>  	gboolean	temporary;
>  	struct agent	*agent;
>  	guint		disconn_timer;
> @@ -267,8 +268,12 @@ static void device_free(gpointer user_data)
>  	g_slist_free_full(device->attios, g_free);
>  	g_slist_free_full(device->attios_offline, g_free);
>  
> +	g_slist_free(device->bonding_callbacks);
> +
>  	att_cleanup(device);
>  
> +	g_attrib_unref(device->attrib);
> +

This seems unrelated to your series.

>  	if (device->tmp_records)
>  		sdp_list_free(device->tmp_records,
>  					(sdp_free_func_t) sdp_record_free);
> @@ -2542,6 +2547,20 @@ static void device_auth_req_free(struct btd_device *device)
>  	device->authr = NULL;
>  }
>  
> +void btd_device_register_bonding_cb(struct btd_device *device,
> +						btd_device_bonding_cb_t cb)
> +{
> +	device->bonding_callbacks = g_slist_prepend(
> +						device->bonding_callbacks, cb);
> +}
> +
> +void btd_device_unregister_bonding_cb(struct btd_device *device,
> +						btd_device_bonding_cb_t cb)
> +{
> +	device->bonding_callbacks = g_slist_remove(
> +						device->bonding_callbacks, cb);
> +}
> +
>  gboolean device_is_retrying(struct btd_device *device)
>  {
>  	struct bonding_req *bonding = device->bonding;
> diff --git a/src/device.h b/src/device.h
> index f06042c..2a7409a 100644
> --- a/src/device.h
> +++ b/src/device.h
> @@ -103,6 +103,14 @@ guint device_add_disconnect_watch(struct btd_device *device,
>  void device_remove_disconnect_watch(struct btd_device *device, guint id);
>  void device_set_class(struct btd_device *device, uint32_t value);
>  
> +typedef gboolean (*btd_device_bonding_cb_t) (struct btd_device *device,
> +					gboolean complete, uint8_t status);
> +
> +void btd_device_register_bonding_cb(struct btd_device *dev,
> +						btd_device_bonding_cb_t cb);
> +void btd_device_unregister_bonding_cb(struct btd_device *dev,
> +						btd_device_bonding_cb_t cb);
> +
>  #define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )
>  
>  struct btd_device_driver {
> -- 
> 1.7.7.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Cheers,
-- 
Vinicius

  reply	other threads:[~2012-04-05 22:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 22:40 [PATCHv3 0/4] Support bonding callsbacks and retrying bondings Scott James Remnant
2012-04-05 22:40 ` [PATCHv3 1/4] Add support for retrying a bonding Scott James Remnant
2012-04-05 22:40 ` [PATCHv3 2/4] plugin: Add bonding callback support for plugins Scott James Remnant
2012-04-05 22:54   ` Vinicius Costa Gomes [this message]
2012-04-06 19:37     ` Scott James Remnant
2012-04-06 19:37     ` [PATCHv3 2/4v2] bonding: retry if callback returns TRUE Scott James Remnant
2012-04-12 11:28       ` Johan Hedberg
2012-04-05 22:40 ` [PATCHv3 3/4] " Scott James Remnant
2012-04-05 22:40 ` [PATCHv3 4/4] bonding: call plugin callback on cancellation Scott James Remnant

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=20120405225446.GA19517@samus \
    --to=vinicius.gomes@openbossa.org \
    --cc=hadess@hadess.net \
    --cc=keybuk@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=scott@netsplit.com \
    /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;
as well as URLs for NNTP newsgroup(s).