aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Desneux <stephane.desneux@iot.bzh>2019-10-17 13:41:13 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2019-10-17 13:41:13 +0000
commit090489aaf5a42eda5cfb414572e01dc986073fb1 (patch)
tree6ce4b43c547789ffeeb4d0fadffcb47fa5219450
parent3cccc427e10f158926a2d78457cb4a0e82a878ed (diff)
parentbb538c86503e1f507cb51e269e3709e48458c325 (diff)
Merge "Add a function for dynamic dependencies handling"
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.c20
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.h1
2 files changed, 21 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 6d1afd0..ea92b0e 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.c
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.c
@@ -313,6 +313,26 @@ int HalUtlGetNumberOfProbedDevicesInList(struct cds_list_head *probedDevicesList
return HalUtlGetNumberOfNodesInList(probedDevicesListHead);
}
+int HalUtlGetNumberOfDynamicProbedDevicesInList(struct cds_list_head *probedDevicesListHead)
+{
+ int numberOfDynamicProbedDevicesInList = 0;
+
+ struct InternalHalProbedDevice *currentProbedDevice;
+
+ if(! probedDevicesListHead)
+ return -1;
+
+ if(cds_list_empty(probedDevicesListHead))
+ return 0;
+
+ cds_list_for_each_entry(currentProbedDevice, probedDevicesListHead, node) {
+ if(currentProbedDevice->deviceClass == DYNAMIC_PROBED_DEVICE)
+ numberOfDynamicProbedDevicesInList++;
+ }
+
+ return numberOfDynamicProbedDevicesInList;
+}
+
struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct cds_list_head *probedDevicesListHead,
char *uid)
{
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h
index 0b62416..8e94078 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.h
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h
@@ -159,6 +159,7 @@ int HalUtlRemoveSelectedProbedDeviceFromList(struct cds_list_head *probedDevices
struct InternalHalProbedDevice *probedDeviceToRemove);
int HalUtlRemoveAllProbedDevicesFromList(struct cds_list_head *probedDevicesListHead);
int HalUtlGetNumberOfProbedDevicesInList(struct cds_list_head *probedDevicesListHead);
+int HalUtlGetNumberOfDynamicProbedDevicesInList(struct cds_list_head *probedDevicesListHead);
struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct cds_list_head *probedDevicesListHead,
char *uid);
int HalUtlGetProbedDeviceCardNbUsingUid(struct cds_list_head *probedDevicesListHead, char *uid);