[PATCH BlueZ 4/9] tools/btpclient: Add btp disconnect handler

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

 



This patch adds btp disconnect handler to btp client.
---
 tools/btpclient.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/btpclient.c b/tools/btpclient.c
index 3d9e449ce..4097c05d0 100644
--- a/tools/btpclient.c
+++ b/tools/btpclient.c
@@ -2892,6 +2892,12 @@ static void client_disconnected(struct l_dbus *dbus, void *user_data)
 	l_main_quit();
 }
 
+static void btp_disconnect_handler(struct btp *btp, void *user_data)
+{
+	l_info("btp disconnected");
+	l_main_quit();
+}
+
 static void client_ready(struct l_dbus_client *client, void *user_data)
 {
 	l_info("D-Bus client ready, connecting BTP");
@@ -2903,6 +2909,8 @@ static void client_ready(struct l_dbus_client *client, void *user_data)
 		return;
 	}
 
+	btp_set_disconnect_handler(btp, btp_disconnect_handler, NULL, NULL);
+
 	register_core_service();
 
 	btp_send(btp, BTP_CORE_SERVICE, BTP_EV_CORE_READY,
-- 
2.13.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