Skip to contentSkip to conversation

client: Display address if calling 'disconnect' without arguments

PATCH Applied Mateusz Lemusisk 2 participants 2 messages Jun 21, 2015 – Jun 23, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 client: Display address if calling 'disconnect' without arguments

Simplified the patch

---
 client/main.c | 5 +++++
 1 file changed, 5 insertions(+)
client/main.c +5 -0
index 41e95b2..f1a600f 100644
@@ -1421,7 +1421,12 @@ static void cmd_disconn(const char *arg)
 		rl_printf("Failed to disconnect\n");
 		return;
 	}
+	if (strlen(arg) == 0) {
+		DBusMessageIter iter;
 
+		if (g_dbus_proxy_get_property(proxy, "Address", &iter) == TRUE)
+		    dbus_message_iter_get_basic(&iter, &arg);
+	}
 	rl_printf("Attempting to disconnect from %s\n", arg);
 }
 
Signature · 4 lines
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
maintainer Applied
#1 lore raw

Hi Mateusz,

Quoted 23 lines · Mateusz Lemusisk

Simplified the patch

---
 client/main.c | 5 +++++
 1 file changed, 5 insertions(+)
client/main.c +5 -1
index 41e95b2..f1a600f 100644
@@ -1421,7 +1421,12 @@ static void cmd_disconn(const char *arg)
                rl_printf("Failed to disconnect\n");
                return;
        }
+       if (strlen(arg) == 0) {
+               DBusMessageIter iter;
 
+               if (g_dbus_proxy_get_property(proxy, "Address", &iter) == TRUE)
+                   dbus_message_iter_get_basic(&iter, &arg);
+       }
        rl_printf("Attempting to disconnect from %s\n", arg);
 }
 
--
Quoted 1 line

2.4.2

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz