diff options
Diffstat (limited to 'plugins/lib/bluetooth/hal-bt.c')
-rw-r--r-- | plugins/lib/bluetooth/hal-bt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/lib/bluetooth/hal-bt.c b/plugins/lib/bluetooth/hal-bt.c index 36b5ba6..bc89fe1 100644 --- a/plugins/lib/bluetooth/hal-bt.c +++ b/plugins/lib/bluetooth/hal-bt.c @@ -37,6 +37,8 @@ CTLP_CAPI_REGISTER(HAL_BT_PLUGIN_NAME) // Call at initialisation time CTLP_ONLOAD(plugin, callbacks) { + CtlConfigT *ctrlConfig; + AFB_ApiNotice(plugin->api, "Hal-Bt Plugin Registered: uid='%s' 'info='%s'", plugin->uid, plugin->info); memset(&localHalBtPluginData, '\0', sizeof(localHalBtPluginData)); @@ -46,6 +48,16 @@ CTLP_ONLOAD(plugin, callbacks) return -1; } + if(! (ctrlConfig = (CtlConfigT *) afb_dynapi_get_userdata(plugin->api))) { + AFB_ApiError(plugin->api, "Can't get current hal controller config"); + return -2; + } + + if(! (localHalBtPluginData.currentHalData = (struct SpecificHalData *) ctrlConfig->external)) { + AFB_ApiError(plugin->api, "%s: Can't get current hal controller data", __func__); + return -3; + } + /* TDB JAI : - Register 'init' plugin function (HAL_BT_PLUGIN_NAME#init) as onload action here (to avoid adding it in json) - Register 'event' plugin function (HAL_BT_PLUGIN_NAME#event) as action for BT_MANAGER_API#BT_MANAGER_DEVICE_UPDATE_EVENT event here (to avoid adding it in json) |