diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-10-30 11:39:25 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-11-23 08:49:14 -0800 |
commit | c19902405ebe92a17efe041cae9a3584c3b182e5 (patch) | |
tree | f0135d733f77a938bac29a64a24d9e2f3afed421 /binding/bluetooth-util.c | |
parent | 9796db317ac252bd99584471421fb757a19d23d3 (diff) |
binding: bluetooth: add initial discovery filter support
Allow clients to request devices only with certain profile UUIDs to be
displayed in an discovery scan. This allows to filter out things like
location tokens, smart scales, and etc which can't possibly have a2dp
or hfp profiles for instance.
NOTE: This is a write only setting. In the future should be read/write
to see current discovery filters.
Bug-AGL: SPEC-1630
Change-Id: Ic8b18656f84ac8047b170d6e601fcc2e63786af0
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-util.c')
-rw-r--r-- | binding/bluetooth-util.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/binding/bluetooth-util.c b/binding/bluetooth-util.c index f57b43e..21aae6c 100644 --- a/binding/bluetooth-util.c +++ b/binding/bluetooth-util.c @@ -1051,3 +1051,18 @@ gchar *return_bluez_path(afb_req_t request) { return g_strconcat("/org/bluez/", adapter, "/", device, NULL); } + +gchar **json_array_to_strv(json_object *jobj) +{ + int len = json_object_array_length(jobj); + gchar **val = g_malloc0(sizeof(gchar *) * (len + 1)); + int i; + + for (i = 0; i < len; i++) { + json_object *jstr = json_object_array_get_idx(jobj, i); + const char *str = json_object_get_string(jstr); + val[i] = g_strdup(str); + } + + return val; +} |