From 62a466a8934bd3240aa202bdf28103617220619b Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 24 Sep 2018 14:40:32 +0800 Subject: 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 --- binding/bluetooth-util.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'binding/bluetooth-util.c') diff --git a/binding/bluetooth-util.c b/binding/bluetooth-util.c index 0af4898..e826aaf 100644 --- a/binding/bluetooth-util.c +++ b/binding/bluetooth-util.c @@ -1024,3 +1024,15 @@ json_object *get_named_property(const struct property_info *pi, return jret; } + +void json_process_path(json_object *jresp, const char *path) { + gchar *tmp; + + tmp = bluez_return_adapter(path); + json_object_object_add(jresp, "adapter", json_object_new_string(tmp)); + g_free(tmp); + + tmp = bluez_return_device(path); + json_object_object_add(jresp, "device", json_object_new_string(tmp)); + g_free(tmp); +} -- cgit 1.2.3-korg