From 0318b2b91f9929b08390e5b403620d8d778a7955 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Wed, 19 Dec 2018 11:04:37 +0100 Subject: Correct halmap calls request json syntax Correct halmap calls request json syntax : The request json must be a json_object type. Change-Id: If443b5480678354193c2419a72ffb711fadd416f Signed-off-by: Jonathan Aillet --- 4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to '4a-hal/4a-hal-controllers') diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c index e08958c..dbe339c 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c @@ -467,14 +467,9 @@ void HalCtlsActionOnAlsaCtl(AFB_ReqT request) return; } - switch(json_object_get_type(requestJson)) { - case json_type_object : - case json_type_array : - break; - - default: - AFB_ReqFailF(request, "request_json", "Request json is not valid '%s'", json_object_get_string(requestJson)); - return; + if(! json_object_is_type(requestJson, json_type_object)) { + AFB_ReqFailF(request, "request_json", "Request json is not valid '%s'", json_object_get_string(requestJson)); + return; } snprintf(cardIdString, 6, "hw:%i", currentCtlHalData->sndCardId); -- cgit 1.2.3-korg