aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-09-07 18:56:37 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:57:27 +0200
commit57c1e0bf737735854b19d5d43adf5645e1b52913 (patch)
treec26728d2e29b407cf89e8b8ae26ee01f24e1f75b
parent6b215041cfe7b072344704d820bbe74fe07ab8eb (diff)
Test afb require result at hal-bt plugin load
Test afb require on 'Bluetooth-Manager' result at hal-bt plugin load before keep going with plugin hal-bt load actions. Change-Id: I19983d12ad6634acafc6cc32d96dbae554c70245 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r--plugins/lib/bluetooth/hal-bt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/lib/bluetooth/hal-bt.c b/plugins/lib/bluetooth/hal-bt.c
index 98e0b40..36b5ba6 100644
--- a/plugins/lib/bluetooth/hal-bt.c
+++ b/plugins/lib/bluetooth/hal-bt.c
@@ -41,7 +41,10 @@ CTLP_ONLOAD(plugin, callbacks)
memset(&localHalBtPluginData, '\0', sizeof(localHalBtPluginData));
- AFB_RequireApi(plugin->api, BT_MANAGER_API, 1);
+ if(AFB_RequireApi(plugin->api, BT_MANAGER_API, 1)) {
+ AFB_ApiError(plugin->api, "Didn't succeed to require %s api", BT_MANAGER_API);
+ return -1;
+ }
/* TDB JAI :
- Register 'init' plugin function (HAL_BT_PLUGIN_NAME#init) as onload action here (to avoid adding it in json)