summaryrefslogtreecommitdiff
path: root/client/advertising.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-12-14 16:24:44 -0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-01-19 11:44:09 -0200
commit65eff5c2ebb5e231edb0b26d812f3b5f5287666e (patch)
treeab727779cd666a0e18c9f8f7283bfeafb16f1da1 /client/advertising.c
parent6f20dba32d398c5bdae56abc1ce7c234e5a047ca (diff)
downloadbluez-65eff5c2ebb5e231edb0b26d812f3b5f5287666e.tar.gz
client: Rename set-service to service
Make the command return the current value if no parameters: [bluetooth]# service 0x1820 00 00 00 [bluetooth]# service UUID: Internet Protocol Support (0x1820) 00 00 00 ...
Diffstat (limited to 'client/advertising.c')
-rw-r--r--client/advertising.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/advertising.c b/client/advertising.c
index 5174417a8..974462124 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -498,15 +498,16 @@ void ad_advertise_service(DBusConnection *conn, int argc, char *argv[])
unsigned int i;
struct ad_data *data;
- ad_clear_service();
-
- if (argc < 2)
+ if (argc < 2 || !strlen(argv[1])) {
+ print_uuid(ad.service.uuid);
+ bt_shell_hexdump(ad.service.data.data, ad.service.data.len);
return;
+ }
ad.service.uuid = g_strdup(argv[1]);
data = &ad.service.data;
- for (i = 1; i < (unsigned int) argc; i++) {
+ for (i = 2; i < (unsigned int) argc; i++) {
long int val;
char *endptr = NULL;