diff options
Diffstat (limited to '4a-hal/4a-hal-utilities')
-rw-r--r-- | 4a-hal/4a-hal-utilities/4a-hal-utilities-data.c | 19 | ||||
-rw-r--r-- | 4a-hal/4a-hal-utilities/4a-hal-utilities-data.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c index d585f5d..b2c4b25 100644 --- a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c +++ b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c @@ -187,6 +187,25 @@ struct SpecificHalData *HalUtlSearchHalDataByApiName(struct SpecificHalData **fi return NULL; } + +struct SpecificHalData *HalUtlSearchReadyHalDataByCarId(struct SpecificHalData **firstHalData, int cardId) +{ + struct SpecificHalData *currentApi; + + if(! firstHalData) + return NULL; + + currentApi = *firstHalData; + while(currentApi) { + if(currentApi->status == HAL_STATUS_READY && currentApi->sndCardId == cardId) + return currentApi; + + currentApi = currentApi->next; + } + + return NULL; +} + /******************************************************************************* * Hal Manager data handling functions * ******************************************************************************/ diff --git a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h index 16befde..a79a7f1 100644 --- a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h +++ b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h @@ -96,6 +96,7 @@ uint8_t HalUtlRemoveSelectedHalFromList(struct SpecificHalData **firstHalData, s uint64_t HalUtlRemoveAllHalFromList(struct SpecificHalData **firstHalData); uint64_t HalUtlGetNumberOfHalInList(struct SpecificHalData **firstHalData); struct SpecificHalData *HalUtlSearchHalDataByApiName(struct SpecificHalData **firstHalData, char *apiName); +struct SpecificHalData *HalUtlSearchReadyHalDataByCarId(struct SpecificHalData **firstHalData, int cardId); // Exported verbs for 'struct HalMgrData' handling uint8_t HalUtlInitializeHalMgrData(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData, char *apiName, char *info); |