From: Scott James Remnant <scott@netsplit.com>
To: linux-bluetooth@vger.kernel.org
Cc: keybuk@chromium.org, marcel@holtmann.org, hadess@hadess.net,
Scott James Remnant <scott@netsplit.com>
Subject: [PATCHv3 4/4] bonding: call plugin callback on cancellation
Date: Thu, 5 Apr 2012 15:40:53 -0700 [thread overview]
Message-ID: <1333665653-30266-5-git-send-email-scott@netsplit.com> (raw)
In-Reply-To: <1333665653-30266-1-git-send-email-scott@netsplit.com>
Call the plugin callbacks when a bonding request is cancelled.
---
src/device.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/device.c b/src/device.c
index 343e2bc..448c8fd 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2715,6 +2715,8 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
struct bonding_req *bonding = device->bonding;
DBusMessage *reply;
char addr[18];
+ GSList *l;
+ btd_device_bonding_cb_t cb;
if (!bonding)
return;
@@ -2722,6 +2724,14 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
ba2str(&device->bdaddr, addr);
DBG("Canceling bonding request for %s", addr);
+ for (l = device->bonding_callbacks; l != NULL; l = g_slist_next(l)) {
+ cb = l->data;
+ cb(device, FALSE, 0);
+ }
+
+ g_slist_free(device->bonding_callbacks);
+ device->bonding_callbacks = NULL;
+
if (device->authr)
device_cancel_authentication(device, FALSE);
--
1.7.7.3
prev parent reply other threads:[~2012-04-05 22:40 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
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 ` Scott James Remnant [this message]
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=1333665653-30266-5-git-send-email-scott@netsplit.com \
--to=scott@netsplit.com \
--cc=hadess@hadess.net \
--cc=keybuk@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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;
as well as URLs for NNTP newsgroup(s).