summaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluetooth/hal-bt-cb.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/lib/bluetooth/hal-bt-cb.c')
-rw-r--r--plugins/lib/bluetooth/hal-bt-cb.c17
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(&currentBtDeviceObjectJ,
- "{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'