From 26e4b4b0d7ccc237fc0102103f9ad9ce8fe5c679 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Tue, 11 Sep 2018 17:31:26 +0200 Subject: Improve Hal-Bt print messages Improve Hal-Bt print messages by changing the print level of messages, by adding some messages, and by add information for some existing messages. Also improve response of requests. Change-Id: Icf6dc9f4da1a2ee912dda2850464926c68f2eda6 Signed-off-by: Jonathan Aillet --- plugins/lib/bluetooth/hal-bt-data.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'plugins/lib/bluetooth/hal-bt-data.c') 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; -- cgit 1.2.3-korg