diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-09-07 18:40:34 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-10-08 15:57:27 +0200 |
commit | 6b215041cfe7b072344704d820bbe74fe07ab8eb (patch) | |
tree | b2b654e0c5d4fd3e3f073c1b06070ab2f49d28dd /plugins/lib/bluetooth/hal-bt-cb.c | |
parent | 624971371bba5ca9a9fa6a862c70b0e928e5649c (diff) |
Add handling of hci and profile in hal-bt plugin
Add handling of bluetoothg hci and bluetooth profile when keep bluetooth
connected devices up to date.
Change-Id: I49b3e67136168bcae711eb8f7ffb2e1ccdbad3ae
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'plugins/lib/bluetooth/hal-bt-cb.c')
-rw-r--r-- | plugins/lib/bluetooth/hal-bt-cb.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-cb.c b/plugins/lib/bluetooth/hal-bt-cb.c index 243b3b9..f57f7ac 100644 --- a/plugins/lib/bluetooth/hal-bt-cb.c +++ b/plugins/lib/bluetooth/hal-bt-cb.c @@ -98,9 +98,11 @@ void HalBtGetConnectedBluetoothDevices(AFB_ReqT request) while(currentBtDeviceData) { wrap_json_pack(¤tBtDeviceObjectJ, - "{s:s s:s}", + "{s:s s:s s:s s:b}", + "Hci", currentBtDeviceData->hci, "Name", currentBtDeviceData->name, - "Address", currentBtDeviceData->address); + "Address", currentBtDeviceData->address, + "A2dp", currentBtDeviceData->a2dp); json_object_array_add(requestAnswer, currentBtDeviceObjectJ); currentBtDeviceData = currentBtDeviceData->next; @@ -126,9 +128,11 @@ void HalBtGetSelectedBluetoothDevice(AFB_ReqT request) } wrap_json_pack(&selectedBtDeviceObject, - "{s:s s:s}", + "{s:s s:s s:s s:b}", + "Hci", localHalBtPluginData->selectedBtDevice->hci, "Name", localHalBtPluginData->selectedBtDevice->name, - "Address", localHalBtPluginData->selectedBtDevice->address); + "Address", localHalBtPluginData->selectedBtDevice->address, + "A2dp", localHalBtPluginData->selectedBtDevice->a2dp); AFB_ReqSuccess(request, selectedBtDeviceObject, "Selected Bluetooth device"); } @@ -162,6 +166,11 @@ void HalBtSetSelectedBluetoothDevice(AFB_ReqT request) return; } + if(! selectedBtDeviceData->a2dp) { + AFB_ReqFail(request, "requested_device_to_select", "Requested bluetooth device to select is not able to use A2DP profile"); + return; + } + localHalBtPluginData->selectedBtDevice = selectedBtDeviceData; // TODO JAI : Tell the softmixer that we want it as an input using 'bluealsa:HCI=hci0,DEV=F6:32:15:2A:80:70,PROFILE=a2dp' |