summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-12-10 08:17:16 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-12-10 17:57:31 +0000
commit4137e7f3b9f0bcb633724878c7f19e55c8273982 (patch)
tree68fe2ab12b981807831f369624960480f7179342
parentf2aaebf3f8c1f9e71586a9d5f5c370d3338c07cf (diff)
binding: bluetooth: add MediaTransport1 to managed_objects output
To allow initial reporting of MediaTransport1 of audio transports add them to the managed_objects verb. Bug-AGL: SPEC-1630 SPEC-1986 Change-Id: Icc09ae063e5dfc52e5396b9ea7149178b1d8aaac Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--README.md15
-rw-r--r--binding/bluetooth-bluez.c16
2 files changed, 28 insertions, 3 deletions
diff --git a/README.md b/README.md
index 50870df..162e550 100644
--- a/README.md
+++ b/README.md
@@ -110,7 +110,20 @@ This verb allows an client to get initial paired devices, and discovered unpaire
"servicesresolved": false
}
},
-...
+ ],
+ "transports": [
+ {
+ "endpoint": "fd1",
+ "adapter": "hci0",
+ "device": "dev_D0_81_7A_5A_BC_5E",
+ "properties": {
+ "uuid": "0000110B-0000-1000-8000-00805F9B34FB",
+ "state": "idle",
+ "volume": 127
+ }
+ }
+ ],
+}
</pre>
diff --git a/binding/bluetooth-bluez.c b/binding/bluetooth-bluez.c
index a52d225..60be18a 100644
--- a/binding/bluetooth-bluez.c
+++ b/binding/bluetooth-bluez.c
@@ -350,7 +350,7 @@ json_object *bluez_get_properties(struct bluetooth_state *ns,
GVariant *var = NULL;
const char *interface, *interface2, *path2 = NULL;
const gchar *key = NULL;
- json_object *jarray = NULL, *jarray2 = NULL;
+ json_object *jarray = NULL, *jarray2 = NULL, *jarray3 = NULL;
json_object *jprop = NULL, *jresp = NULL, *jtype = NULL;
gboolean is_config;
@@ -415,13 +415,14 @@ json_object *bluez_get_properties(struct bluetooth_state *ns,
g_variant_unref(reply);
jresp = jprop;
} else if (!strcmp(access_type, BLUEZ_AT_OBJECT)) {
-
jarray = json_object_new_array();
jarray2 = json_object_new_array();
+ jarray3 = json_object_new_array();
jresp = json_object_new_object();
json_object_object_add(jresp, "adapters", jarray);
json_object_object_add(jresp, "devices", jarray2);
+ json_object_object_add(jresp, "transports", jarray3);
g_variant_get(reply, "(a{oa{sa{sv}}})", &array);
while (g_variant_iter_loop(array, "{oa{sa{sv}}}", &path2, &array2)) {
@@ -444,6 +445,17 @@ json_object *bluez_get_properties(struct bluetooth_state *ns,
array = jarray2;
json_process_path(jtype, path2);
+ } else if (!strcmp(interface, BLUEZ_MEDIATRANSPORT_INTERFACE)) {
+ gchar *endpoint = find_index(path2, 5);
+
+ access_type = BLUEZ_AT_MEDIATRANSPORT;
+ array = jarray3;
+
+ json_object_object_add(jtype, "endpoint",
+ json_object_new_string(endpoint));
+ g_free(endpoint);
+
+ json_process_path(jtype, path2);
} else {
json_object_put(jtype);
continue; /* TODO: Maybe display other interfaces */