summaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluetooth/hal-bt-mixer-link.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-09-11 17:31:26 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:57:27 +0200
commit26e4b4b0d7ccc237fc0102103f9ad9ce8fe5c679 (patch)
tree1376ec0176300f7410630a09f3a6790478781d0e /plugins/lib/bluetooth/hal-bt-mixer-link.c
parent26741cc7c9fa1302016d05f936befc7f1b79bfd0 (diff)
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 <jonathan.aillet@iot.bzh>
Diffstat (limited to 'plugins/lib/bluetooth/hal-bt-mixer-link.c')
-rw-r--r--plugins/lib/bluetooth/hal-bt-mixer-link.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-mixer-link.c b/plugins/lib/bluetooth/hal-bt-mixer-link.c
index 865d63d..714c4e8 100644
--- a/plugins/lib/bluetooth/hal-bt-mixer-link.c
+++ b/plugins/lib/bluetooth/hal-bt-mixer-link.c
@@ -40,12 +40,17 @@ int HalBtMixerLinkSetBtStreamingSettings(AFB_ApiT apiHandle, char *mixerApiName,
if(! apiHandle || ! mixerApiName)
return -1;
- if(! btStreamStatus)
+ if(! btStreamStatus) {
+ AFB_ApiDebug(apiHandle, "Will try to disable bluetooth streamed device");
toSendJ = NULL;
- else if(btStreamStatus == 1 && hci && btAddress)
+ }
+ else if(btStreamStatus == 1 && hci && btAddress) {
+ AFB_ApiDebug(apiHandle, "Will try to change bluetooth streamed device to hci='%s' address='%s'", hci, btAddress);
wrap_json_pack(&toSendJ, "{s:s s:s s:s}", "interface", hci, "device", btAddress, "profile", "a2dp");
- else
- return -3;
+ }
+ else {
+ return -2;
+ }
if(AFB_ServiceSync(apiHandle, mixerApiName, MIXER_SET_STREAMED_BT_DEVICE_VERB, toSendJ, &returnedJ)) {
AFB_ApiError(apiHandle,
@@ -63,5 +68,10 @@ int HalBtMixerLinkSetBtStreamingSettings(AFB_ApiT apiHandle, char *mixerApiName,
return -4;
}
+ if(btStreamStatus)
+ AFB_ApiInfo(apiHandle, "Bluetooth streamed device changed to hci='%s' address='%s'", hci, btAddress);
+ else
+ AFB_ApiInfo(apiHandle, "Bluetooth streamed device disbaled");
+
return 0;
} \ No newline at end of file