diff options
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.c | 79 |
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, ¤tCtlHalData->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 |