summaryrefslogtreecommitdiffstats
path: root/binding-bluetooth/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
commit37aacabc67fc2d3b759cdc85eb46705f729f8682 (patch)
treea5b47bb1156ad77417900a94ddcf2084a1eb68f7 /binding-bluetooth/bluetooth-api.c
parentcaea8eb4305404f0a03e089e7e625833ef66d95f (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 'binding-bluetooth/bluetooth-api.c')
-rw-r--r--binding-bluetooth/bluetooth-api.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/binding-bluetooth/bluetooth-api.c b/binding-bluetooth/bluetooth-api.c
index 34caac5..4a7092a 100644
--- a/binding-bluetooth/bluetooth-api.c
+++ b/binding-bluetooth/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);