diff options
Diffstat (limited to '4a-hal/4a-hal-manager')
-rw-r--r-- | 4a-hal/4a-hal-manager/4a-hal-manager.c | 22 | ||||
-rw-r--r-- | 4a-hal/4a-hal-manager/4a-hal-manager.h | 3 |
2 files changed, 18 insertions, 7 deletions
diff --git a/4a-hal/4a-hal-manager/4a-hal-manager.c b/4a-hal/4a-hal-manager/4a-hal-manager.c index df35d12..f3ebe14 100644 --- a/4a-hal/4a-hal-manager/4a-hal-manager.c +++ b/4a-hal/4a-hal-manager/4a-hal-manager.c @@ -31,6 +31,9 @@ // Default api to print log when apihandle not available AFB_ApiT AFB_default; +// Local (static) Hal manager data structure +static struct HalMgrData localHalMgrGlobalData; + /******************************************************************************* * HAL Manager verbs table * ******************************************************************************/ @@ -49,6 +52,16 @@ struct HalUtlApiVerb HalManagerApiStaticVerbs[] = }; /******************************************************************************* + * HAL Manager get first 'SpecificHalData' structure * + from HAL list function * + ******************************************************************************/ + +struct SpecificHalData **HalMngGetFirstHalData(void) +{ + return &localHalMgrGlobalData.first; +} + +/******************************************************************************* * Dynamic API functions for hal manager * * TBD JAI : Use API-V3 instead of API-PRE-V3 * ******************************************************************************/ @@ -120,27 +133,22 @@ int HalMgrCreateApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) int afbBindingVdyn(AFB_ApiT apiHandle) { int status = 0, rc; - struct HalMgrData *HalMgrGlobalData; if(! apiHandle) return -1; - HalMgrGlobalData = (struct HalMgrData *) calloc(1, sizeof(struct HalMgrData)); - if(! HalMgrGlobalData) - return -2; - // Hugely hack to make all V2 AFB_DEBUG to work in fileutils AFB_default = apiHandle; AFB_ApiNotice(apiHandle, "In %s", __func__); // Load Hal-Manager using DynApi - rc = HalMgrCreateApi(apiHandle, HalMgrGlobalData); + rc = HalMgrCreateApi(apiHandle, &localHalMgrGlobalData); if(rc < 0) status--; // Load Hal-Ctls using DynApi - rc = HalCtlsCreateAllApi(apiHandle, HalMgrGlobalData); + rc = HalCtlsCreateAllApi(apiHandle, &localHalMgrGlobalData); if(rc < 0) status -= rc; diff --git a/4a-hal/4a-hal-manager/4a-hal-manager.h b/4a-hal/4a-hal-manager/4a-hal-manager.h index d5f11e5..9749edc 100644 --- a/4a-hal/4a-hal-manager/4a-hal-manager.h +++ b/4a-hal/4a-hal-manager/4a-hal-manager.h @@ -23,4 +23,7 @@ #define HAL_MANAGER_API_NAME "4a-hal-manager" #define HAL_MANAGER_API_INFO "Manager for 4A HAL APIs" +// HAL Manager get first 'SpecificHalData' structure from HAL list function +struct SpecificHalData **HalMngGetFirstHalData(void); + #endif /* _HALMGR_BINDING_INCLUDE_ */
\ No newline at end of file |