summaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-util.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-11-23 14:24:18 -0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-12-07 12:14:43 +0000
commitdc504cf7676cdca0a2816750d1d287dc2350fbd0 (patch)
treedf081e01f190109a3137f85a63d366df5e7aac95 /binding/bluetooth-util.c
parent1fb7a01eb655bbe1c72a3502c2aa59f27dd3d8dc (diff)
binding: bluetooth: add default_adapter verb
Allow setting of default adapter for use by other verbs within the binding. This allows to select an adapter on boards with more than one. Bug-AGL: SPEC-1630 Change-Id: Iec77b0abaa9f4c092dc5c827522efb1744953fce Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-util.c')
-rw-r--r--binding/bluetooth-util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binding/bluetooth-util.c b/binding/bluetooth-util.c
index e8a0781..f07e5ed 100644
--- a/binding/bluetooth-util.c
+++ b/binding/bluetooth-util.c
@@ -1040,10 +1040,13 @@ void json_process_path(json_object *jresp, const char *path) {
}
gchar *return_bluez_path(afb_req_t request) {
+ struct bluetooth_state *ns = bluetooth_get_userdata(request);
const char *adapter = afb_req_value(request, "adapter");
const char *device, *tmp;
- adapter = adapter ? adapter : BLUEZ_DEFAULT_ADAPTER;
+ call_work_lock(ns);
+ adapter = adapter ? adapter : ns->default_adapter;
+ call_work_unlock(ns);
device = afb_req_value(request, "device");
if (!device)