summaryrefslogtreecommitdiff
path: root/client/advertising.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-12-18 11:12:16 -0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-01-19 11:44:09 -0200
commit821ad2ecd40fcfab5fd0bc06897d8b53d31deacd (patch)
treef1c34cb17a2bea16a86163585f81af07ec10b56d /client/advertising.c
parent0c33c99102bc00e49327ce9ce30a5b43c811f424 (diff)
downloadbluez-821ad2ecd40fcfab5fd0bc06897d8b53d31deacd.tar.gz
client: Rename set-name to name
Make the command return the current value if no parameters: [bluetooth]# name blah [bluetooth]# name LocalName: blah
Diffstat (limited to 'client/advertising.c')
-rw-r--r--client/advertising.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/advertising.c b/client/advertising.c
index 05c69102c..5e63f6dbb 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -619,6 +619,15 @@ void ad_advertise_name(DBusConnection *conn, bool value)
void ad_advertise_local_name(DBusConnection *conn, const char *name)
{
+ if (!name) {
+ if (ad.local_name)
+ bt_shell_printf("LocalName: %s\n", ad.local_name);
+ else
+ bt_shell_printf("Name: %s\n", ad.name ? "on" : "off");
+
+ return;
+ }
+
if (ad.local_name && !strcmp(name, ad.local_name))
return;