From 624971371bba5ca9a9fa6a862c70b0e928e5649c Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Thu, 6 Sep 2018 10:18:25 +0200 Subject: 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 --- plugins/lib/bluetooth/hal-bt.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'plugins/lib/bluetooth/hal-bt.c') 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; -- cgit 1.2.3-korg