diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-09-24 14:40:32 +0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-11-23 08:49:14 -0800 |
commit | cfd9944c77a61215250c3b0f81978a1236d4c590 (patch) | |
tree | b345083c1061d156b2bf1168d7474c419a18864a /binding/bluetooth-api.c | |
parent | dfff48e48f646e021e6d2b8326cd7fdc3d706d9c (diff) |
binding: bluetooth: return adapter/device versus bluez path
To allow this binding API to be bluetooth stack agnostic remove pure
bluez paths, and replace with generic fields.
Bug-AGL: SPEC-1630
Change-Id: Iadba73782b6339df2ca5937e16a654e7ef3e477b
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-api.c')
-rw-r--r-- | binding/bluetooth-api.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c index 28ac6fb..4649067 100644 --- a/binding/bluetooth-api.c +++ b/binding/bluetooth-api.c @@ -262,8 +262,7 @@ static void bluez_devices_signal_callback( jresp = json_object_new_object(); - json_object_object_add(jresp, "device", - json_object_new_string(path)); + json_process_path(jresp, path); json_object_object_add(jresp, "action", json_object_new_string("added")); @@ -307,8 +306,7 @@ static void bluez_devices_signal_callback( jresp = json_object_new_object(); - json_object_object_add(jresp, "path", - json_object_new_string(path)); + json_process_path(jresp, path); json_object_object_add(jresp, "action", json_object_new_string("removed")); @@ -321,8 +319,7 @@ static void bluez_devices_signal_callback( jresp = json_object_new_object(); - json_object_object_add(jresp, "path", - json_object_new_string(object_path)); + json_process_path(jresp, object_path); json_object_object_add(jresp, "action", json_object_new_string("changed")); @@ -609,6 +606,7 @@ static void bluetooth_state(afb_req_t request) afb_req_fail(request, "failed", "No adapter give to return state"); return; } + adapter = BLUEZ_ROOT_PATH(adapter); jresp = adapter_properties(ns, &error, adapter); if (!jresp) { @@ -631,6 +629,7 @@ static void bluetooth_adapter(afb_req_t request) afb_req_fail(request, "failed", "No adapter given to configure"); return; } + adapter = BLUEZ_ROOT_PATH(adapter); scan = afb_req_value(request, "discovery"); if (scan) { |