diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2017-12-18 09:49:47 -0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-01-19 11:44:09 -0200 |
commit | 045e6b9a10c006a2ff93bbc405bb83c6a62e7c98 (patch) | |
tree | 913dca6b8a0ed61647397729f513e95d3b13d61e /client/advertising.c | |
parent | 65eff5c2ebb5e231edb0b26d812f3b5f5287666e (diff) | |
download | bluez-045e6b9a10c006a2ff93bbc405bb83c6a62e7c98.tar.gz |
client: Rename set-manufacturer to manufacturer
Make the command return the current value if no parameters:
[bluetooth]# manufacturer 2 00
[bluetooth]# manufacturer
Manufacturer: 2
00
Diffstat (limited to 'client/advertising.c')
-rw-r--r-- | client/advertising.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/client/advertising.c b/client/advertising.c index 974462124..304ae683e 100644 --- a/client/advertising.c +++ b/client/advertising.c @@ -543,10 +543,18 @@ void ad_advertise_manufacturer(DBusConnection *conn, int argc, char *argv[]) long int val; struct ad_data *data; - ad_clear_manufacturer(); + if (argc < 2 || !strlen(argv[1])) { + if (ad.manufacturer.data.len) { + bt_shell_printf("Manufacturer: %u\n", + ad.manufacturer.id); + bt_shell_hexdump(ad.manufacturer.data.data, + ad.manufacturer.data.len); + } - if (argc < 2) return; + } + + ad_clear_manufacturer(); val = strtol(argv[1], &endptr, 0); if (!endptr || *endptr != '\0' || val > UINT16_MAX) { |