summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-12-19 11:04:37 +0100
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-12-20 10:51:45 +0100
commitcb1dfa94c9c1a647055ac3c8d9b98b35aea8c937 (patch)
tree1c3d6b52022db8e95d9b24057f61169f68b9c688
parentbe746118574c2adbb52f91f79b4178f37cccbc78 (diff)
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 <jonathan.aillet@iot.bzh>
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c11
1 files changed, 3 insertions, 8 deletions
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 c35b3cc..13e1c1d 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);