summaryrefslogtreecommitdiffstats
path: root/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-09 00:30:40 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commit0f6d2131882e05e230f648626b81586c052b4da0 (patch)
treebe871b747128f8fe51c6a7d3ffb3aab6f3ac26b1 /4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
parentcc1ec41093c3b0db3b8bdf8e8949ecdacceda190 (diff)
Move mixer attach at hal startup
Move mixer attach at hal startup instead of making attachment possible only with a verb. Now, if the hal audio device is detected at startup, it will automatically be attached to the mixer. As it is useless now, the verb used to attach mixer has been deleted. Change-Id: I32c8b829ac37fb31ede4fe8830a6f2a699c0835c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c')
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c79
1 files changed, 0 insertions, 79 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
index 5b9f2a8..98d2b0c 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c
@@ -519,83 +519,4 @@ void HalCtlsListVerbs(AFB_ReqT request)
wrap_json_pack(&requestAnswer, "{s:o}", "streams", streamsArray);
AFB_ReqSucess(request, requestAnswer, "Requested data");
-}
-
-void HalCtlsInitMixer(AFB_ReqT request)
-{
- unsigned int err;
-
- char *apiToCall;
-
- AFB_ApiT apiHandle;
- CtlConfigT *ctrlConfig;
-
- struct SpecificHalData *currentCtlHalData;
-
- json_object *returnJ, *toReturnJ;
-
- apiHandle = (AFB_ApiT ) afb_request_get_dynapi(request);
- if(! apiHandle) {
- AFB_ReqFail(request, "api_handle", "Can't get current hal api handle");
- return;
- }
-
- ctrlConfig = (CtlConfigT *) afb_dynapi_get_userdata(apiHandle);
- if(! ctrlConfig) {
- AFB_ReqFail(request, "hal_controller_config", "Can't get current hal controller config");
- return;
- }
-
- currentCtlHalData = (struct SpecificHalData *) ctrlConfig->external;
- if(! currentCtlHalData) {
- AFB_ReqFail(request, "hal_controller_data", "Can't get current hal controller data");
- return;
- }
-
- apiToCall = currentCtlHalData->ctlHalSpecificData->mixerApiName;
- if(! apiToCall) {
- AFB_ReqFail(request, "mixer_api", "Can't get mixer api");
- return;
- }
-
- switch(currentCtlHalData->status) {
- case HAL_STATUS_UNAVAILABLE:
- AFB_ReqFail(request, "hal_unavailable", "Seems that the hal corresponding card was not found by alsacore at startup");
- return;
-
- case HAL_STATUS_READY:
- AFB_ReqSucess(request, NULL, "Seems that the hal mixer is already initialized");
- return;
-
- case HAL_STATUS_AVAILABLE:
- break;
- }
-
- if(AFB_ServiceSync(apiHandle, apiToCall, "create", json_object_get(currentCtlHalData->ctlHalSpecificData->halMixerJ), &returnJ)) {
- HalUtlHandleAppFwCallErrorInRequest(request, apiToCall, "create", returnJ, "mixer_create");
- }
- else if(json_object_object_get_ex(returnJ, "response", &toReturnJ)) {
- err = HalCtlsHandleMixerAttachResponse(request, &currentCtlHalData->ctlHalSpecificData->ctlHalStreamsData, toReturnJ);
- if(err != (int) MIXER_NO_ERROR) {
- AFB_ReqFailF(request,
- "handler_mixer_response",
- "Seems that create call to api %s succeed but this warning was risen by response decoder : %i",
- apiToCall,
- err);
- return;
- }
-
- AFB_ReqSucessF(request,
- toReturnJ,
- "Seems that create call to api %s succeed with no warning raised",
- apiToCall);
-
- currentCtlHalData->status = HAL_STATUS_READY;
- }
- else {
- AFB_ReqFailF(request,
- "invalid_response",
- "Seems that mix_new call to api %s succeed, but response is not valid",
- apiToCall);
- }
} \ No newline at end of file