aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/lib/bluetooth/CMakeLists.txt1
-rw-r--r--plugins/lib/bluetooth/hal-bt-data.h4
-rw-r--r--plugins/lib/bluetooth/hal-bt.c12
3 files changed, 17 insertions, 0 deletions
diff --git a/plugins/lib/bluetooth/CMakeLists.txt b/plugins/lib/bluetooth/CMakeLists.txt
index fa28ae1..5969755 100644
--- a/plugins/lib/bluetooth/CMakeLists.txt
+++ b/plugins/lib/bluetooth/CMakeLists.txt
@@ -42,4 +42,5 @@ PROJECT_TARGET_ADD(hal-bt)
target_include_directories(${TARGET_NAME}
PRIVATE "${CMAKE_SOURCE_DIR}/app-controller/ctl-lib"
+ PRIVATE "${CMAKE_SOURCE_DIR}/4a-hal/4a-hal-utilities"
)
diff --git a/plugins/lib/bluetooth/hal-bt-data.h b/plugins/lib/bluetooth/hal-bt-data.h
index ea3fe99..eb5eb26 100644
--- a/plugins/lib/bluetooth/hal-bt-data.h
+++ b/plugins/lib/bluetooth/hal-bt-data.h
@@ -24,6 +24,8 @@
#include <json-c/json.h>
+#include <4a-hal-utilities-data.h>
+
// Structure to store bluetooth device data
struct HalBtDeviceData {
char *uid;
@@ -41,6 +43,8 @@ struct HalBtDeviceData {
struct HalBtPluginData {
unsigned int btStreamEnabled;
+ struct SpecificHalData *currentHalData;
+
struct HalBtDeviceData *selectedBtDevice;
struct HalBtDeviceData *first;
};
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)