Thread (3 messages) flat view 3 messages, 2 authors, 2011-09-27
STALE5472d

[PATCH BlueZ 2/2] Fix ATT disconnect callback not being called

From: Claudio Takahasi <hidden>
Date: 2011-08-09 16:47:44
Subsystem: the rest · Maintainer: Linus Torvalds

GAttrib disconnect function needs to be set after discovering the
primary services if the connection callback list is not empty. After
creating a device the connection can stay up, for this scenario the
registered disconnection callbacks are not being called.
---
 src/device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/device.c b/src/device.c
index 9dd657c..13749bf 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1661,7 +1661,9 @@ static void primary_cb(GSList *services, guint8 status, gpointer user_data)
 	if (device->attios == NULL && device->attios_offline == NULL) {
 		g_attrib_unref(device->attrib);
 		device->attrib = NULL;
-	}
+	} else
+		g_attrib_set_disconnect_function(device->attrib,
+						attrib_disconnected, device);
 
 	g_slist_free(uuids);
 
-- 
1.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help