diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-12-19 11:04:37 +0100 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2018-12-20 15:18:36 +0100 |
commit | 0318b2b91f9929b08390e5b403620d8d778a7955 (patch) | |
tree | 35dd0f4bdf76859dd4cdb822ab0c7c17c552a2ed /4a-hal | |
parent | 65e5ce833cccd5399446b8488b04c4f038b34b78 (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>
Diffstat (limited to '4a-hal')
-rw-r--r-- | 4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c | 11 |
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 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); |