aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-06-24 14:20:24 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-06-25 09:53:22 +0200
commit7cc44519439f2e96b88f4b9cc68e96d0668ef7ea (patch)
tree73f9ff84ed6027b26561748b7f8cc17de388cba4
parent3bc5eb3c4da0565fd4138344363207eab62fff9a (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>
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.c12
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.h1
2 files changed, 13 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;
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h
index 48420cd..1571485 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.h
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h
@@ -162,6 +162,7 @@ int HalUtlRemoveAllProbedDevicesFromList(struct cds_list_head *probedDevicesList
int HalUtlGetNumberOfProbedDevicesInList(struct cds_list_head *probedDevicesListHead);
struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct cds_list_head *probedDevicesListHead,
char *uid);
+int HalUtlGetProbedDeviceCardNbUsingUid(struct cds_list_head *probedDevicesListHead, char *uid);
struct InternalHalDeviceData *HalUtlAllocateAndFillProbedDeviceDataUsingInfoGetResponse(json_object *responseJ);
json_object *HalUtlGetJsonForSpecificDependencies(afb_api_t apiHandle,
struct InternalHalProbedDevice *requestedProbedDevice,