summaryrefslogtreecommitdiffstats
path: root/4a-hal/4a-hal-controllers
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-09 19:55:01 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commit0c99273762e161b703ce0540596d66947d27e1d1 (patch)
tree6c28b392cdd823548e65098c50bee668a3cee7d4 /4a-hal/4a-hal-controllers
parenta550e2a53728559a20b16dcd2a5eabf447340e6f (diff)
Move controller config exec before onload action
Before, the onload action specified in the audio configuration file (see controller documention) was exectued before the sections configuration execution call. So, the onload action was launched before the hal was ready. Now, onload action is launched last. Change-Id: I05d46622b938ae5a818bd404779a2263ed334397 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-controllers')
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
index 58dad10..13d5490 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
@@ -121,12 +121,12 @@ static int HalCtlsInitOneApi(AFB_ApiT apiHandle)
// TBD JAI: handle refresh of hal status for dynamic card (/dev/by-id)
- return CtlConfigExec(apiHandle, ctrlConfig);
+ return 0;
}
static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle)
{
- int err;
+ int err = 0;
CtlConfigT *ctrlConfig;
if(! cbdata || ! apiHandle )
@@ -144,13 +144,17 @@ static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle)
}
// Load section for corresponding Api
- err = CtlLoadSections(apiHandle, ctrlConfig, ctrlSections);
+ err += CtlLoadSections(apiHandle, ctrlConfig, ctrlSections);
// Declare an event manager for this Api
afb_dynapi_on_event(apiHandle, HalCtlsDispatchApiEvent);
// Init Api function (does not receive user closure ???)
- afb_dynapi_on_init(apiHandle, HalCtlsInitOneApi);
+ afb_dynapi_on_init(apiHandle, NULL);
+
+ err += HalCtlsInitOneApi(apiHandle);
+
+ err += CtlConfigExec(apiHandle, ctrlConfig);
return err;
}