linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] device: don't auto-connect on disc-cb attio callback registration
@ 2012-03-08 13:44 Arik Nemtsov
  2012-03-08 13:44 ` [PATCH 2/2] Revert "core: Add provision for terminating an ATT connection" Arik Nemtsov
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Arik Nemtsov @ 2012-03-08 13:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Arik Nemtsov

If a device is already connected, don't auto-connect if we register
a disconnect-only attio callback. This will obviously fail.
---
 src/device.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/device.c b/src/device.c
index dfc8e59..b339ac1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2942,10 +2942,15 @@ guint btd_device_add_attio_callback(struct btd_device *device,
 	attio->dcfunc = dcfunc;
 	attio->user_data = user_data;
 
-	if (device->attrib && cfunc) {
-		device->attios_offline = g_slist_append(device->attios_offline,
-									attio);
-		g_idle_add(notify_attios, device);
+	if (device->attrib) {
+		if (cfunc) {
+			device->attios_offline =
+				g_slist_append(device->attios_offline, attio);
+
+			g_idle_add(notify_attios, device);
+		} else {
+			device->attios = g_slist_append(device->attios, attio);
+		}
 	} else {
 		device->auto_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,
 						att_connect, device,
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-15 10:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08 13:44 [PATCH 1/2] device: don't auto-connect on disc-cb attio callback registration Arik Nemtsov
2012-03-08 13:44 ` [PATCH 2/2] Revert "core: Add provision for terminating an ATT connection" Arik Nemtsov
2012-03-08 13:47   ` Arik Nemtsov
2012-03-14 12:08   ` Anderson Lizardo
2012-03-14 12:11     ` Arik Nemtsov
2012-03-14 12:40       ` Anderson Lizardo
2012-03-14 12:03 ` [PATCH 1/2] device: don't auto-connect on disc-cb attio callback registration Anderson Lizardo
2012-03-14 12:09   ` Arik Nemtsov
2012-03-14 12:49     ` Anderson Lizardo
2012-03-15 10:13 ` Johan Hedberg

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).