diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-04-18 11:32:54 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-05-24 16:35:06 +0200 |
commit | fc650808aef4b161490d0997be621f17377be684 (patch) | |
tree | bdfecb2c08c393a2bea7d3d48970b90cc0a0b8e0 | |
parent | 7ad5bb65277de0031ed59937a8b2e2fa9773ab70 (diff) |
Store 'uid' metadata in hal data structure
'uid' field is currently used to store the audio device to
search for the hal. But with haldependencies' feature,
'uid' field won't be used to search for the audio device anymore.
So, 'uid' field is stored elsewhere into the hal data structure
(returned when asking for hal informations).
BUG-AGL: SPEC-2329
Change-Id: Ib3b2b3bacaecfa80a51f94f9d6874789baba0224
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.h | 1 | ||||
-rw-r--r-- | src/4a-hal-manager/4a-hal-manager-cb.c | 3 | ||||
-rw-r--r-- | src/4a-internals-hal/4a-internals-hal-api-loader.c | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h index b3874e7..dd89078 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-data.h +++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h @@ -68,6 +68,7 @@ struct HalData { enum HalStatus status; char *sndCardPath; int sndCardId; + char *uid; char *info; unsigned int internal; diff --git a/src/4a-hal-manager/4a-hal-manager-cb.c b/src/4a-hal-manager/4a-hal-manager-cb.c index facc15c..dd55eeb 100644 --- a/src/4a-hal-manager/4a-hal-manager-cb.c +++ b/src/4a-hal-manager/4a-hal-manager-cb.c @@ -117,11 +117,12 @@ void HalMgrLoaded(afb_req_t request) snprintf(cardIdString, sizeof(cardIdString), "not-found"); wrapRet = wrap_json_pack(&apiRequestedInfoJ, - "{s:s s:i s:s s:i s:s s:s s:s s:s s:s}", + "{s:s s:i s:s s:i s:s s:s s:s s:s s:s s:s}", "api", currentHalData->apiName, "status", (int) currentHalData->status, "sndcard", currentHalData->sndCardPath, "internal", (int) currentHalData->internal, + "uid", currentHalData->uid, "info", currentHalData->info ? currentHalData->info : "", "author", currentHalData->author ? currentHalData->author : "", "version", currentHalData->version ? currentHalData->version : "", diff --git a/src/4a-internals-hal/4a-internals-hal-api-loader.c b/src/4a-internals-hal/4a-internals-hal-api-loader.c index 9cb3481..839b3a7 100644 --- a/src/4a-internals-hal/4a-internals-hal-api-loader.c +++ b/src/4a-internals-hal/4a-internals-hal-api-loader.c @@ -87,6 +87,7 @@ static int InternalHalInitOneApi(afb_api_t apiHandle) currentHalData->internal = 1; currentHalData->sndCardPath = (char *) ctrlConfig->uid; + currentHalData->uid = (char *) ctrlConfig->uid; currentHalData->info = (char *) ctrlConfig->info; currentHalData->author = (char *) ctrlConfig->author; |