aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluetooth/hal-bt-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/lib/bluetooth/hal-bt-data.c')
-rw-r--r--plugins/lib/bluetooth/hal-bt-data.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-data.c b/plugins/lib/bluetooth/hal-bt-data.c
index cfcb57d..eefd9f1 100644
--- a/plugins/lib/bluetooth/hal-bt-data.c
+++ b/plugins/lib/bluetooth/hal-bt-data.c
@@ -220,15 +220,27 @@ int HalBtDataHandleReceivedSingleBtDeviceData(struct HalBtPluginData *halBtPlugi
if(HalBtDataRemoveSelectedBtDeviceFromList(&halBtPluginData->first, currentBtDevice))
return -3;
- if(halBtPluginData->selectedBtDevice == currentBtDevice)
+ AFB_ApiInfo(halBtPluginData->currentHalApiHandle, "Bluetooth device (address = %s) successfully removed from list", currentBtDeviceAddress);
+
+ if(halBtPluginData->selectedBtDevice == currentBtDevice) {
halBtPluginData->selectedBtDevice = halBtPluginData->first;
+ AFB_ApiDebug(halBtPluginData->currentHalApiHandle,
+ "Bluetooth selected device changed to '%s'",
+ halBtPluginData->selectedBtDevice ? halBtPluginData->selectedBtDevice->address : "none");
+ }
}
else if(! currentBtDevice && currentBtDeviceIsConnected) {
if(! HalBtDataAddBtDeviceToBtDeviceList(&halBtPluginData->first, currentSingleBtDeviceDataJ))
return -4;
- if(! halBtPluginData->selectedBtDevice)
+ AFB_ApiInfo(halBtPluginData->currentHalApiHandle, "Bluetooth device (address = %s) successfully added from list", currentBtDeviceAddress);
+
+ if(! halBtPluginData->selectedBtDevice) {
halBtPluginData->selectedBtDevice = halBtPluginData->first;
+ AFB_ApiDebug(halBtPluginData->currentHalApiHandle,
+ "Bluetooth selected device changed to '%s'",
+ halBtPluginData->selectedBtDevice ? halBtPluginData->selectedBtDevice->address : "none");
+ }
}
return 0;