diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-01-15 13:36:26 -0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-01-19 11:44:09 -0200 |
commit | f309255a99231004e48900e39c66b7a0f94eeafd (patch) | |
tree | 158cca8e7463018a1f165b7410e615e53251dacc /client/advertising.c | |
parent | aebb7e197384658d1a579442089bf8e52aa2e2c0 (diff) | |
download | bluez-f309255a99231004e48900e39c66b7a0f94eeafd.tar.gz |
client: Rename set-duration to duration
Make the command return the current value if no parameters:
[bluetooth]# duration 1
[bluetooth]# duration
Duration: 1 sec
Diffstat (limited to 'client/advertising.c')
-rw-r--r-- | client/advertising.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/advertising.c b/client/advertising.c index 944251db0..2c6cff1a1 100644 --- a/client/advertising.c +++ b/client/advertising.c @@ -672,12 +672,18 @@ void ad_advertise_local_appearance(DBusConnection *conn, long int *value) g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE, "Appearance"); } -void ad_advertise_duration(DBusConnection *conn, uint16_t value) +void ad_advertise_duration(DBusConnection *conn, long int *value) { - if (ad.duration == value) + if (!value) { + if (ad.duration) + bt_shell_printf("Duration: %u sec\n", ad.duration); + return; + } + + if (ad.duration == *value) return; - ad.duration = value; + ad.duration = *value; g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE, "Duration"); } |