diff options
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.c | 20 | ||||
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.h | 1 |
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); |