From 6c91d284591e33fd39fcf8cdd07ad3261433bc2d Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 11 Dec 2017 11:37:49 +0100 Subject: [PATCH] client: Print Address type in show and info commands --- client/main.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/client/main.c b/client/main.c index 3b43ed777..4747f1c10 100644 --- a/client/main.c +++ b/client/main.c @@ -870,7 +870,16 @@ static void cmd_show(int argc, char *argv[]) return; dbus_message_iter_get_basic(&iter, &address); - bt_shell_printf("Controller %s\n", address); + + if (g_dbus_proxy_get_property(proxy, "AddressType", &iter) == TRUE) { + const char *type; + + dbus_message_iter_get_basic(&iter, &type); + + bt_shell_printf("Controller %s (%s)\n", address, type); + } else { + bt_shell_printf("Controller %s\n", address); + } print_property(proxy, "Name"); print_property(proxy, "Alias"); @@ -1510,7 +1519,16 @@ static void cmd_info(int argc, char *argv[]) return; dbus_message_iter_get_basic(&iter, &address); - bt_shell_printf("Device %s\n", address); + + if (g_dbus_proxy_get_property(proxy, "AddressType", &iter) == TRUE) { + const char *type; + + dbus_message_iter_get_basic(&iter, &type); + + bt_shell_printf("Device %s (%s)\n", address, type); + } else { + bt_shell_printf("Device %s\n", address); + } print_property(proxy, "Name"); print_property(proxy, "Alias"); -- 2.47.3