[PATCH BlueZ 3/4] client: Add envs for proxies

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This adds envs for device and adapter proxies found so other files are
able to access them.
---
 client/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/client/main.c b/client/main.c
index 584217a82..a36e932ac 100644
--- a/client/main.c
+++ b/client/main.c
@@ -456,6 +456,7 @@ static void device_added(GDBusProxy *proxy)
 
 	adapter->devices = g_list_append(adapter->devices, proxy);
 	print_device(proxy, COLORED_NEW);
+	bt_shell_set_env(g_dbus_proxy_get_path(proxy), proxy);
 
 	if (default_dev)
 		return;
@@ -494,6 +495,7 @@ static void adapter_added(GDBusProxy *proxy)
 	adapter->proxy = proxy;
 
 	print_adapter(proxy, COLORED_NEW);
+	bt_shell_set_env(g_dbus_proxy_get_path(proxy), proxy);
 }
 
 static void ad_manager_added(GDBusProxy *proxy)
@@ -561,6 +563,7 @@ static void device_removed(GDBusProxy *proxy)
 	adapter->devices = g_list_remove(adapter->devices, proxy);
 
 	print_device(proxy, COLORED_DEL);
+	bt_shell_set_env(g_dbus_proxy_get_path(proxy), NULL);
 
 	if (default_dev == proxy)
 		set_default_device(NULL, NULL);
@@ -575,6 +578,7 @@ static void adapter_removed(GDBusProxy *proxy)
 
 		if (adapter->proxy == proxy) {
 			print_adapter(proxy, COLORED_DEL);
+			bt_shell_set_env(g_dbus_proxy_get_path(proxy), NULL);
 
 			if (default_ctrl && default_ctrl->proxy == proxy) {
 				default_ctrl = NULL;
-- 
2.14.3

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