summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-09-06 10:18:25 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:57:27 +0200
commit624971371bba5ca9a9fa6a862c70b0e928e5649c (patch)
treef432069412545033b750424fa7e73db1e883741a /plugins
parentf410a02a35b565de39f247c8ee48e7b98ff78432 (diff)
Fix little mistakes/typo in hal bluetooth plugin
Correct typo. Remove an unnecessary message print. Update returned error code. Change-Id: If52965b8c7158dfd17bbba411d6dc2c4aafe970a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/lib/bluetooth/hal-bt-cb.c2
-rw-r--r--plugins/lib/bluetooth/hal-bt.c24
2 files changed, 12 insertions, 14 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-cb.c b/plugins/lib/bluetooth/hal-bt-cb.c
index c4f0231..243b3b9 100644
--- a/plugins/lib/bluetooth/hal-bt-cb.c
+++ b/plugins/lib/bluetooth/hal-bt-cb.c
@@ -121,7 +121,7 @@ void HalBtGetSelectedBluetoothDevice(AFB_ReqT request)
}
if(! localHalBtPluginData->selectedBtDevice) {
- AFB_ReqSuccess(request, NULL, "No bluetooth device connected, cannot provide selected device");
+ AFB_ReqSuccess(request, NULL, "No bluetooth device selected");
return;
}
diff --git a/plugins/lib/bluetooth/hal-bt.c b/plugins/lib/bluetooth/hal-bt.c
index 32fbbf7..98e0b40 100644
--- a/plugins/lib/bluetooth/hal-bt.c
+++ b/plugins/lib/bluetooth/hal-bt.c
@@ -37,7 +37,7 @@ CTLP_CAPI_REGISTER(HAL_BT_PLUGIN_NAME)
// Call at initialisation time
CTLP_ONLOAD(plugin, callbacks)
{
- AFB_ApiNotice(plugin->api, "Hal-Bt Plugin Register: uid='%s' 'info='%s'", plugin->uid, plugin->info);
+ AFB_ApiNotice(plugin->api, "Hal-Bt Plugin Registered: uid='%s' 'info='%s'", plugin->uid, plugin->info);
memset(&localHalBtPluginData, '\0', sizeof(localHalBtPluginData));
@@ -51,7 +51,7 @@ CTLP_ONLOAD(plugin, callbacks)
return 0;
}
-// Call at onload time
+// Call at contoller onload time
CTLP_CAPI(init, source, argsJ, queryJ)
{
unsigned int err;
@@ -120,9 +120,9 @@ CTLP_CAPI(init, source, argsJ, queryJ)
wrap_json_pack(&toSendJ, "{s:s}", "value", BT_MANAGER_DEVICE_UPDATE_EVENT);
if(AFB_ServiceSync(source->api, BT_MANAGER_API, BT_MANAGER_SUBSCRIBE_VERB, toSendJ, &returnedJ)) {
AFB_ApiError(source->api,
- "Error during call to verb %s of %s api",
- BT_MANAGER_API,
- BT_MANAGER_SUBSCRIBE_VERB);
+ "Error during call to verb '%s' of '%s' api",
+ BT_MANAGER_SUBSCRIBE_VERB,
+ BT_MANAGER_API);
return -6;
}
@@ -132,23 +132,23 @@ CTLP_CAPI(init, source, argsJ, queryJ)
BT_MANAGER_DEVICE_UPDATE_EVENT,
BT_MANAGER_SUBSCRIBE_VERB,
BT_MANAGER_API);
- return -7;
+ return -6;
}
if(AFB_ServiceSync(source->api, BT_MANAGER_API, BT_MANAGER_GET_DEVICES_VERB, NULL, &returnedJ)) {
AFB_ApiError(source->api,
- "Error during call to verb %s of %s api",
- BT_MANAGER_API,
- BT_MANAGER_GET_DEVICES_VERB);
+ "Error during call to verb '%s' of '%s' api",
+ BT_MANAGER_GET_DEVICES_VERB,
+ BT_MANAGER_API);
- return -8;
+ return -7;
}
else if(wrap_json_unpack(returnedJ, "{s:{s:o}}", "response", "list", &returnedBtList)) {
AFB_ApiError(source->api,
"Couldn't get bluetooth device list during call to verb '%s' of api '%s'",
BT_MANAGER_GET_DEVICES_VERB,
BT_MANAGER_API);
- return -9;
+ return -7;
}
if((err = HalBtDataHandleReceivedMutlipleBtDeviceData(&localHalBtPluginData, returnedBtList)))
@@ -171,8 +171,6 @@ CTLP_CAPI(events, source, argsJ, queryJ)
{
struct HalBtDeviceData *previouslySelectedBtDevice = localHalBtPluginData.selectedBtDevice;
- AFB_ApiNotice(source->api, "JAI: bt event received: %s", json_object_get_string(queryJ));
-
if(HalBtDataHandleReceivedSingleBtDeviceData(&localHalBtPluginData, queryJ)) {
AFB_ApiError(source->api, "Error while decoding bluetooth event received json (%s)", json_object_get_string(queryJ));
return -1;