[RFC BlueZ v0 5/5] Send D-Bus signal to propagate disconnect reason

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

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

Propagate the disconnection reason through D-Bus, allowing other
components to react accordingly.
---
 src/device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/device.c b/src/device.c
index b2b9d54..8c124d1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -891,6 +891,7 @@ static GDBusMethodTable device_methods[] = {
 static GDBusSignalTable device_signals[] = {
 	{ "PropertyChanged",		"sv"	},
 	{ "DisconnectRequested",	""	},
+	{ "Disconnected",		"y"	},
 	{ }
 };
 
@@ -942,6 +943,11 @@ void device_remove_connection(struct btd_device *device, DBusConnection *conn,
 	if (device_is_paired(device) && !device_is_bonded(device))
 		device_set_paired(device, FALSE);
 
+	g_dbus_emit_signal(conn, device->path,
+			DEVICE_INTERFACE, "Disconnected",
+			DBUS_TYPE_BYTE, &reason,
+			DBUS_TYPE_INVALID);
+
 	emit_property_changed(conn, device->path,
 					DEVICE_INTERFACE, "Connected",
 					DBUS_TYPE_BOOLEAN, &device->connected);
-- 
1.7.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