bios: Add support for enum value display names
This commits adds changes to add support for the value
display names for the Enum BIOS attributes.
GET on
/redfish/v1/Registries/BiosAttributeRegistry/BiosAttributeRegistry/
shows list of Attributes under RegistryEntries. Each
attribute corresponds to a knob in BIOS.
If knob in BIOS is of type Enumeration, it will have
'option' with 'text' and 'value'. This text should be
mapped to attribute->Value->ValueDisplayName.
This change only applies to ENUM type of BIOS attributes
and does not make sense for Integer and String attributes.
Hence, we are sending attribute name in place of the
value display name field for these attributes.
The corresponding bios-setting-mgr change which mandated
this change in PLDM is at-
[1] https://github.com/openbmc/bios-settings-mgr/commit/1a448ad88fdaec7e082b4a1c437f7f3c990402cd
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: Ib2882c93e81a70332e4897b196ae812b63cf6184
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index 77a0764..10cc013 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -47,7 +47,9 @@
using DefaultValue = std::variant<int64_t, std::string>;
using OptionString = std::string;
using OptionValue = std::variant<int64_t, std::string>;
-using Option = std::vector<std::tuple<OptionString, OptionValue>>;
+using ValueDisplayName = std::string;
+using Option =
+ std::vector<std::tuple<OptionString, OptionValue, ValueDisplayName>>;
using BIOSTableObj =
std::tuple<AttributeType, ReadonlyStatus, DisplayName, Description,
MenuPath, CurrentValue, DefaultValue, Option>;