summaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluetooth/hal-bt-cb.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-09-11 17:12:54 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:57:27 +0200
commite185efc0a2ed5b8d295d29a7afadd84342b80549 (patch)
tree1ef23e05a76c0d009d45b727b0762bdf6ab0b553 /plugins/lib/bluetooth/hal-bt-cb.c
parent3a7a1127600dd92367609edb02ef74bcb1b55ff8 (diff)
HalBt plugin keeps list of connected A2DP devices
Hal-Bt plugin only keeps list of connected bluetooth A2DP devices instead of a list of all connected bluetooth devices. Change-Id: I6c06be78a927dcac32ed4683d44431514e7daf06 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.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-cb.c b/plugins/lib/bluetooth/hal-bt-cb.c
index dad6aa0..c75830d 100644
--- a/plugins/lib/bluetooth/hal-bt-cb.c
+++ b/plugins/lib/bluetooth/hal-bt-cb.c
@@ -92,7 +92,7 @@ void HalBtSetStreamingStatus(AFB_ReqT request)
AFB_ReqSuccess(request, NULL, "Bluetooth streaming status successfully set");
}
-void HalBtGetConnectedBluetoothDevices(AFB_ReqT request)
+void HalBtGetA2DPBluetoothDevices(AFB_ReqT request)
{
struct HalBtPluginData *localHalBtPluginData;
struct HalBtDeviceData *currentBtDeviceData;
@@ -105,7 +105,7 @@ void HalBtGetConnectedBluetoothDevices(AFB_ReqT request)
}
if(! (currentBtDeviceData = localHalBtPluginData->first)) {
- AFB_ReqSuccess(request, NULL, "No bluetooth device connected");
+ AFB_ReqSuccess(request, NULL, "No A2DP bluetooth device connected");
return;
}
@@ -120,17 +120,16 @@ void HalBtGetConnectedBluetoothDevices(AFB_ReqT request)
"{s:s s:s s:s s:b}",
"Hci", currentBtDeviceData->hci,
"Name", currentBtDeviceData->name,
- "Address", currentBtDeviceData->address,
- "A2dp", currentBtDeviceData->a2dp);
+ "Address", currentBtDeviceData->address);
json_object_array_add(requestAnswer, currentBtDeviceObjectJ);
currentBtDeviceData = currentBtDeviceData->next;
}
- AFB_ReqSuccess(request, requestAnswer, "Connected bluetooth devices list");
+ AFB_ReqSuccess(request, requestAnswer, "Connected A2DP bluetooth devices list");
}
-void HalBtGetSelectedBluetoothDevice(AFB_ReqT request)
+void HalBtGetSelectedA2DPBluetoothDevice(AFB_ReqT request)
{
struct HalBtPluginData *localHalBtPluginData;
@@ -150,13 +149,12 @@ void HalBtGetSelectedBluetoothDevice(AFB_ReqT request)
"{s:s s:s s:s s:b}",
"Hci", localHalBtPluginData->selectedBtDevice->hci,
"Name", localHalBtPluginData->selectedBtDevice->name,
- "Address", localHalBtPluginData->selectedBtDevice->address,
- "A2dp", localHalBtPluginData->selectedBtDevice->a2dp);
+ "Address", localHalBtPluginData->selectedBtDevice->address);
AFB_ReqSuccess(request, selectedBtDeviceObject, "Selected Bluetooth device");
}
-void HalBtSetSelectedBluetoothDevice(AFB_ReqT request)
+void HalBtSetSelectedA2DPBluetoothDevice(AFB_ReqT request)
{
char *requestedBtDeviceToSelect;
@@ -188,12 +186,7 @@ void HalBtSetSelectedBluetoothDevice(AFB_ReqT request)
}
if(! (selectedBtDeviceData = HalBtDataSearchBtDeviceByAddress(&localHalBtPluginData->first, requestedBtDeviceToSelect))) {
- AFB_ReqFail(request, "requested_device_to_select", "Requested bluetooth device to select is not currently connected");
- return;
- }
-
- if(! selectedBtDeviceData->a2dp) {
- AFB_ReqFail(request, "requested_device_to_select", "Requested bluetooth device to select is not able to use A2DP profile");
+ AFB_ReqFail(request, "requested_device_to_select", "Requested A2DP bluetooth device to select is not currently connected");
return;
}