support runtime update of BIOS attributes
Register the BIOSConfig/PendingAttributes signal and when the out of band
redfish user updates the BIOS attributes, the pldm daemon should process and
check the PendingAttributes porperty, and then update the
BIOSConfig/BaseBIOSTable property and the BIOS table.
Tested: test JSON with
https://gist.github.com/lxwinspur/2afffff2e445fddf90dfed6eceef4014
Type.Enumeration:
~#: busctl set-property xyz.openbmc_project.BIOSConfigManager
/xyz/openbmc_project/bios_config/manager
xyz.openbmc_project.BIOSConfig.Manager PendingAttributes a\{s\(sv\)\} 1
"Led" "xyz.openbmc_project.BIOSConfig.Manager.AttributeType.Enumeration" s
"xyz.openbmc_project.Led.Physical.Action.On"
~#: pldmtool bios getbiostable -t 2
PLDM AttributeValueTable:
... ...
AttributeHandle: 3
AttributeType: BIOSEnumeration
NumberOfCurrentValues: 1
CurrentValueStringHandleIndex[0] = 0, StringHandle = On
... ...
Type.String
~#: busctl set-property xyz.openbmc_project.BIOSConfigManager
/xyz/openbmc_project/bios_config/manager
xyz.openbmc_project.BIOSConfig.Manager PendingAttributes a\{s\(sv\)\} 1
"Model" "xyz.openbmc_project.BIOSConfig.Manager.AttributeType.String" s
"testModel"
~#: pldmtool bios getbiostable -t 2
PLDM AttributeValueTable:
AttributeHandle: 0
AttributeType: BIOSString
CurrentStringLength: 10
CurrentString: testModel
... ...
Type.Integer
~#: busctl set-property xyz.openbmc_project.BIOSConfigManager
/xyz/openbmc_project/bios_config/manager
xyz.openbmc_project.BIOSConfig.Manager PendingAttributes a\{s\(sv\)\} 1
"OUTLET" "xyz.openbmc_project.BIOSConfig.Manager.AttributeType.Integer" x
1000
~#: pldmtool bios getbiostable -t 2
... ...
AttributeHandle: 2
AttributeType: BIOSInteger
CurrentValue: 1000
... ...
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I4d4d2941e6c9bfa7f6fccb664db1580f2ffc9c9f
diff --git a/libpldmresponder/bios_integer_attribute.hpp b/libpldmresponder/bios_integer_attribute.hpp
index e180066..5f2773a 100644
--- a/libpldmresponder/bios_integer_attribute.hpp
+++ b/libpldmresponder/bios_integer_attribute.hpp
@@ -47,6 +47,15 @@
void constructEntry(const BIOSStringTable& stringTable, Table& attrTable,
Table& attrValueTable) override;
+ /** @brief Generate attribute entry by the spec DSP0247_1.0.0 Table 14
+ * @param[in] attributevalue - attribute value(Enumeration, String and
+ * Integer)
+ * @param[in,out] attrValueEntry - attribute entry
+ */
+ void generateAttributeEntry(
+ const std::variant<int64_t, std::string>& attributevalue,
+ Table& attrValueEntry) override;
+
int updateAttrVal(Table& newValue, uint16_t attrHdl, uint8_t attrType,
const PropertyValue& newPropVal);