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

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

 



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

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