diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.c | 12 | ||||
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.h | 1 |
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, |