summaryrefslogtreecommitdiffstats
path: root/bluetooth-api.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-05-31 02:44:02 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-05-31 10:11:41 -0700
commite0d6d332bdb69e4635abfbe00e340211eb8c967a (patch)
treeb46c0af51183918b510b7357bcec901327b608b2 /bluetooth-api.c
parent49b1952b45d45a0dbec2662f26e2cf2e08531b48 (diff)
binding: bluetooth: provide org.bluez.MediaTransport1 access
Allow binding to report transport state and volume levels Bug-AGL: SPEC-642 Change-Id: I5daad68a096b70b6401cde045704ee4226ef368f Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'bluetooth-api.c')
-rw-r--r--bluetooth-api.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/bluetooth-api.c b/bluetooth-api.c
index 34caac5..4a7092a 100644
--- a/bluetooth-api.c
+++ b/bluetooth-api.c
@@ -253,6 +253,20 @@ static json_object *new_json_object_from_device(struct btd_device *BDdevice, uns
}
}
+ if (BD_TRANSPORT_STATE & filter)
+ {
+ jstring = BDdevice->transport_state ?
+ json_object_new_string(BDdevice->transport_state) :
+ json_object_new_string("none");
+ json_object_object_add(jresp, "TransportState", jstring);
+ }
+
+ if (BD_TRANSPORT_VOLUME & filter)
+ {
+ json_object_object_add(jresp, "TransportVolume",
+ json_object_new_int(BDdevice->transport_volume));
+ }
+
if (BD_HFPCONNECTED & filter)
{
jstring = (TRUE == BDdevice->hfpconnected) ?
@@ -751,7 +765,8 @@ void bt_broadcast_device_removed(struct btd_device *BDdevice)
void bt_broadcast_device_properties_change(struct btd_device *BDdevice)
{
- unsigned int filter = BD_ADDER|BD_NAME|BD_PAIRED|BD_ACLCONNECTED|BD_AVCONNECTED|BD_HFPCONNECTED|BD_AVRCP_TITLE|BD_AVRCP_ARTIST|BD_AVRCP_STATUS|BD_AVRCP_DURATION|BD_AVRCP_POSITION;
+ unsigned int filter = BD_ADDER|BD_NAME|BD_PAIRED|BD_ACLCONNECTED|BD_AVCONNECTED|BD_HFPCONNECTED|BD_AVRCP_TITLE|BD_AVRCP_ARTIST|BD_AVRCP_STATUS|BD_AVRCP_DURATION|BD_AVRCP_POSITION|BD_TRANSPORT_STATE|BD_TRANSPORT_VOLUME;
+
int ret;
json_object *jresp = new_json_object_from_device(BDdevice, filter);