All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Updated bluetoothctl command to remove all devices
@ 2016-01-22 14:38 Francois Beaufort
  2016-01-23 12:03 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Beaufort @ 2016-01-22 14:38 UTC (permalink / raw)
  To: linux-bluetooth

---
 client/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/client/main.c b/client/main.c
index b695744..1361e80 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1317,6 +1317,7 @@ static void remove_device_setup(DBusMessageIter *iter, void *user_data)
 static void cmd_remove(const char *arg)
 {
 	GDBusProxy *proxy;
+	GList *list;
 	char *path;
 
 	if (!arg || !strlen(arg)) {
@@ -1327,6 +1328,14 @@ static void cmd_remove(const char *arg)
 	if (check_default_ctrl() == FALSE)
 		return;
 
+	if (strcmp(arg, "*") == 0) {
+		for (list = g_list_first(dev_list); list; list = g_list_next(list)) {
+			GDBusProxy *proxy = list->data;
+			cmd_remove(g_dbus_proxy_get_path(proxy));
+		}
+		return;
+	}
+
 	proxy = find_proxy_by_address(dev_list, arg);
 	if (!proxy) {
 		rl_printf("Device %s not available\n", arg);
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-23 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 14:38 [PATCH v2] Updated bluetoothctl command to remove all devices Francois Beaufort
2016-01-23 12:03 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.