diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-06-06 15:22:45 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-06-06 15:29:04 +0200 |
commit | 7b0f5cbc7e27204d334766a3a270352603805e12 (patch) | |
tree | 3ae902d3e555417f68553fc8a400c7f0b4033f07 | |
parent | b6191f84c7dd39e298607ac81be94eb4ee4bc26e (diff) |
Add 'hal-dependencies' info at hal 'info' call
Add available 'hal-dependencies' full json info in response
of hal 'info' verb call.
BUG-AGL: SPEC-2329
Change-Id: I74615b84d015d142a6aebc291fb9e849a053344a
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r-- | src/4a-internals-hal/4a-internals-hal-cb.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-cb.c b/src/4a-internals-hal/4a-internals-hal-cb.c index 3e6ddfe..ef24cc4 100644 --- a/src/4a-internals-hal/4a-internals-hal-cb.c +++ b/src/4a-internals-hal/4a-internals-hal-cb.c @@ -1028,7 +1028,8 @@ void InternalHalInfo(afb_req_t request) *toReturnJ = NULL, *requestAnswer, *streamsArray, - *controlsArray; + *controlsArray, + *dependenciesArray; apiHandle = afb_req_get_api(request); if(! apiHandle) { @@ -1072,6 +1073,14 @@ void InternalHalInfo(afb_req_t request) return; } + dependenciesArray = HalUtlGetJsonArrayForAvailableDependencies(apiHandle, + ¤tHalData->internalHalData->probedDevicesList, + DEPENDENCY_FULL_JSON); + if(! dependenciesArray) { + afb_req_fail(request, "dependencies_data", "Didn't succeed to generate dependencies data array"); + return; + } + streamsArray = HalUtlGetJsonArrayForAllMixersData(apiHandle, ¤tHalData->internalHalData->streamsData); if(! streamsArray) { @@ -1087,9 +1096,10 @@ void InternalHalInfo(afb_req_t request) } wrapRet = wrap_json_pack(&requestAnswer, - "{s:o s:o}", + "{s:o s:o s:o}", "streams", streamsArray, - "controls", controlsArray); + "controls", controlsArray, + "dependencies", dependenciesArray); if(wrapRet) { afb_req_fail(request, "halinfo_json_object", |