aboutsummaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-bluez.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-09-24 14:40:32 +0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-11-23 08:49:14 -0800
commitcfd9944c77a61215250c3b0f81978a1236d4c590 (patch)
treeb345083c1061d156b2bf1168d7474c419a18864a /binding/bluetooth-bluez.c
parentdfff48e48f646e021e6d2b8326cd7fdc3d706d9c (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-bluez.c')
-rw-r--r--binding/bluetooth-bluez.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/binding/bluetooth-bluez.c b/binding/bluetooth-bluez.c
index 990a244..7640046 100644
--- a/binding/bluetooth-bluez.c
+++ b/binding/bluetooth-bluez.c
@@ -372,22 +372,28 @@ json_object *bluez_get_properties(struct bluetooth_state *ns,
while (g_variant_iter_loop(array2, "{&sa{sv}}", &interface, &array3)) {
json_object *array = NULL;
+ gchar *tmp = NULL;
+
+ jtype = json_object_new_object();
if (!strcmp(interface, BLUEZ_ADAPTER_INTERFACE)) {
access_type = BLUEZ_AT_ADAPTER;
array = jarray;
+
+ tmp = bluez_return_adapter(path2);
+ json_object_object_add(jtype, "name", json_object_new_string(tmp));
+ g_free(tmp);
} else if (!strcmp(interface, BLUEZ_DEVICE_INTERFACE)) {
access_type = BLUEZ_AT_DEVICE;
array = jarray2;
+
+ json_process_path(jtype, path2);
} else {
+ json_object_put(jtype);
continue; /* TODO: Maybe display other interfaces */
}
pi = bluez_get_property_info(access_type, error);
- jtype = json_object_new_object();
-
- json_object_object_add(jtype, "path",
- json_object_new_string(path2));
while (g_variant_iter_loop(array3, "{sv}", &key, &var)) {
if (!jprop)