From 2b558bb1ec9f854769c556e84735e7dcd3a295e8 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Wed, 23 Jan 2019 13:56:06 +0100 Subject: Migrate to newer application framework calls Migrate from 'afb_api_call_sync_legacy' function to 'afb_api_call_sync' function, therefore, handle function return and response json differently from before. Change-Id: Ia7fb42188b8d41e22db2d824459a0d10ed6d6a8e Signed-off-by: Jonathan Aillet --- 4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c') 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 d648103..98d8d53 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-cb.c @@ -25,7 +25,6 @@ #include #include "4a-hal-utilities-data.h" -#include "4a-hal-utilities-appfw-responses-handler.h" #include "4a-hal-controllers-cb.h" #include "4a-hal-controllers-alsacore-link.h" @@ -487,7 +486,7 @@ json_object *HalCtlsGetJsonArrayForControls(afb_api_t apiHandle, struct CtlHalAl void HalCtlsInfo(afb_req_t request) { - char *apiToCall, *returnedStatus = NULL, *returnedInfo = NULL; + char *apiToCall, *returnedError = NULL, *returnedInfo = NULL; afb_api_t apiHandle; CtlConfigT *ctrlConfig; @@ -521,17 +520,12 @@ void HalCtlsInfo(afb_req_t request) return; } - if(HalCtlsGetInfoFromMixer(apiHandle, apiToCall, requestJson, &toReturnJ, &returnedStatus, &returnedInfo)) { - if(returnedStatus && returnedInfo) { - afb_req_fail_f(request, - "mixer_info", - "Call to mixer info verb didn't succeed with status '%s' and info '%s'", - returnedStatus, - returnedInfo); - } - else { - afb_req_fail(request, "mixer_info", "Call to mixer info verb didn't succeed"); - } + if(HalCtlsGetInfoFromMixer(apiHandle, apiToCall, requestJson, &toReturnJ, &returnedError, &returnedInfo)) { + afb_req_fail_f(request, + "mixer_info", + "Call to mixer info verb didn't succeed with status '%s' and info '%s'", + returnedError ? returnedError : "not returned", + returnedInfo ? returnedInfo : "not returned"); return; } -- cgit 1.2.3-korg