diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-06-24 14:20:24 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-06-25 09:53:22 +0200 |
commit | 7cc44519439f2e96b88f4b9cc68e96d0668ef7ea (patch) | |
tree | 73f9ff84ed6027b26561748b7f8cc17de388cba4 /lib/4a-hal-utilities/4a-hal-utilities-data.c | |
parent | 3bc5eb3c4da0565fd4138344363207eab62fff9a (diff) |
Add function to get probed device card number
Add function to get probed device card number using its uid.
BUG-AGL: SPEC-2329
Change-Id: I75bd368d0b1d0ab6d41fc0d75b30511fa7e8584f
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.c')
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.c b/lib/4a-hal-utilities/4a-hal-utilities-data.c index 979f46d..3ac2a7c 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-data.c +++ b/lib/4a-hal-utilities/4a-hal-utilities-data.c @@ -302,6 +302,18 @@ struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct cds_list return NULL; } +int HalUtlGetProbedDeviceCardNbUsingUid(struct cds_list_head *probedDevicesListHead, char *uid) +{ + struct InternalHalProbedDevice *currentProbedDeviceData; + + currentProbedDeviceData = HalUtlSearchProbedDeviceDataById(probedDevicesListHead, uid); + if(! currentProbedDeviceData || + ! currentProbedDeviceData->deviceData) + return HAL_UNKNOWN_DEVICE; + + return currentProbedDeviceData->deviceData->cardNb; +} + struct InternalHalDeviceData *HalUtlAllocateAndFillProbedDeviceDataUsingInfoGetResponse(json_object *responseJ) { struct InternalHalDeviceData *currentProbedDeviceData; |