From 66623af9225cb98e2c2491ad8608eb814513ae10 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Thu, 6 Jun 2019 15:06:55 +0200 Subject: Add func to generate 'hal-dependencies' info json Add functions to generate 'hal-dependencies' information json. Provide two type of json generation ('compact' with only extended card number info, and 'full' with all ALSA card info). Provide function to get information about all 'hal-dependencies' and another function to get information about validated 'hal-dependencies'. BUG-AGL: SPEC-2329 Change-Id: If04cbbab7c79a066d2d03fa5ff16ea698de9b018 Signed-off-by: Jonathan Aillet --- lib/4a-hal-utilities/4a-hal-utilities-data.h | 41 +++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.h') diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h index 6d5cd2d..c051373 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-data.h +++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h @@ -34,17 +34,30 @@ // Enum for hal status enum HalStatus { - HAL_STATUS_UNAVAILABLE=0, - HAL_STATUS_AVAILABLE=1, - HAL_STATUS_READY=2 + HAL_STATUS_UNAVAILABLE = 0, + HAL_STATUS_AVAILABLE = 1, + HAL_STATUS_READY = 2 }; // Enum for probed devices (dependencies) class enum ProbedDeviceClasses { - INVALID_PROBED_DEVICE=0, - STATIC_PROBED_DEVICE=1, - DYNAMIC_PROBED_DEVICE=2, - MANDATORY_PROBED_DEVICE=3 + INVALID_PROBED_DEVICE = 0, + STATIC_PROBED_DEVICE = 1, + DYNAMIC_PROBED_DEVICE = 2, + MANDATORY_PROBED_DEVICE = 3 +}; + +// Enum for probed devices (dependencies) info format requested +enum DependencyInfoJsonFormat { + DEPENDENCY_COMPACT_JSON = 0, + DEPENDENCY_FULL_JSON = 1 +}; + +// Enum for probed devices (dependencies) info format requested +enum DependencyStatus { + UNAVAILABLE_DEPENDENCY = 0, + AVAILABLE_DEPENDENCY = 1, + ALL_DEPENDENCY = 2 }; // Structure to store data for audio devices validated by dependencies @@ -132,6 +145,7 @@ struct HalMgrData { // Internal Hal - Probed devices structure handling functions enum ProbedDeviceClasses HalUtlGetProbedDeviceClassFromString(char *probedDeviceString); +char *HalUtlGetProbedDeviceClassString(enum ProbedDeviceClasses deviceClass); struct InternalHalProbedDevice *HalUtlAddProbedDeviceToProbedDeviceList(struct InternalHalProbedDevice **probedDevicesList); int HalUtlRemoveSelectedProbedDeviceFromList(struct InternalHalProbedDevice **probedDevicesList, struct InternalHalProbedDevice *probedDeviceToRemove); @@ -140,6 +154,19 @@ int HalUtlGetNumberOfProbedDevicesInList(struct InternalHalProbedDevice **probed struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct InternalHalProbedDevice **probedDevicesList, char *uid); struct InternalHalDeviceData *HalUtlAllocateAndFillProbedDeviceDataUsingInfoGetResponse(json_object *responseJ); +json_object *HalUtlGetJsonForSpecificDependencies(afb_api_t apiHandle, + struct InternalHalProbedDevice *requestedProbedDevice, + enum DependencyInfoJsonFormat jsonFormat); +json_object *HalUtlGetJsonForSpecificDependenciesUsingUid(afb_api_t apiHandle, + struct InternalHalProbedDevice **probedDevicesList, + char *uid, + enum DependencyInfoJsonFormat jsonFormat); +json_object *HalUtlGetJsonArrayForAvailableDependencies(afb_api_t apiHandle, + struct InternalHalProbedDevice **probedDevicesList, + enum DependencyInfoJsonFormat jsonFormat); +json_object *HalUtlGetJsonArrayForAllDependencies(afb_api_t apiHandle, + struct InternalHalProbedDevice **probedDevicesList, + enum DependencyInfoJsonFormat jsonFormat); // Internal Hal - Streams data handling functions struct InternalHalMixerData *HalUtlAddMixerDataToMixerDataList(struct InternalHalMixerData **mixerDataList); -- cgit 1.2.3-korg