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_attribute.hpp b/libpldmresponder/bios_attribute.hpp
index 46c34cd..c07d86f 100644
--- a/libpldmresponder/bios_attribute.hpp
+++ b/libpldmresponder/bios_attribute.hpp
@@ -22,6 +22,7 @@
{
using Json = nlohmann::json;
+using ValueDisplayNamesMap = std::map<uint16_t, std::vector<std::string>>;
/** @class BIOSAttribute
* @brief Provide interfaces to implement specific types of attributes
@@ -99,6 +100,8 @@
const std::string helpText;
+ ValueDisplayNamesMap valueDisplayNamesMap;
+
protected:
/** @brief dbus backend, nullopt if this attribute is read-only*/
std::optional<pldm::utils::DBusMapping> dBusMap;