summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/4a-internals-hal/4a-internals-hal-api-loader.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-api-loader.c b/src/4a-internals-hal/4a-internals-hal-api-loader.c
index 68e3bb7..f18f651 100644
--- a/src/4a-internals-hal/4a-internals-hal-api-loader.c
+++ b/src/4a-internals-hal/4a-internals-hal-api-loader.c
@@ -69,6 +69,8 @@ static afb_verb_t InternalHalApiStaticVerbs[] =
static int InternalHalInitOneApi(afb_api_t apiHandle)
{
+ int err;
+
CtlConfigT *ctrlConfig;
struct HalData *currentHalData;
@@ -111,7 +113,16 @@ static int InternalHalInitOneApi(afb_api_t apiHandle)
// TBD JAI: handle refresh of hal status for dynamic card (/dev/by-id)
- return CtlConfigExec(apiHandle, ctrlConfig);
+ err = CtlConfigExec(apiHandle, ctrlConfig);
+ if(err < 0) {
+ AFB_API_ERROR(apiHandle, "Error %i caught when trying to apply current internal hal controller sections", err);
+ return -5;
+ }
+
+ if(err > 0)
+ AFB_API_WARNING(apiHandle, "Warning %i raised when trying to apply current internal hal controller sections", err);
+
+ return 0;
}
static int InternalHalLoadOneApi(void *cbdata, afb_api_t apiHandle)
@@ -144,11 +155,14 @@ static int InternalHalLoadOneApi(void *cbdata, afb_api_t apiHandle)
// Load section for corresponding Api
err = CtlLoadSections(apiHandle, ctrlConfig, ctrlCurrentSections);
- if(err) {
- AFB_API_ERROR(apiHandle, "Didn't succeed to load current internal hal controller section");
+ if(err < 0) {
+ AFB_API_ERROR(apiHandle, "Error %i caught when trying to load current internal hal controller sections", err);
return -4;
}
+ if(err > 0)
+ AFB_API_WARNING(apiHandle, "Warning %i raised when trying to load current internal hal controller sections", err);
+
// Declare an event manager for this Api
afb_api_on_event(apiHandle, InternalHalDispatchApiEvent);