bios: Add SetBIOSAttributeCurrentValue
Update the persisted attribute value table and the d-bus property
corresponding to the attribute.
Tested:
Tested on fp5280g2, with json files:
https://gist.github.com/wangzqbj/b24558331cb35d14fca3b555ef03e458
Build Tables:
pldmtool raw --data 0x80 0x03 0x01 0x00 0x00 0x00 0x00 0x00 0x00
pldmtool raw --data 0x80 0x03 0x01 0x00 0x00 0x00 0x00 0x00 0x01
pldmtool raw --data 0x80 0x03 0x01 0x00 0x00 0x00 0x00 0x00 0x02
enum attribute:
Get Attribute Value By Handle:
root@fp5280g2:/tmp# pldmtool raw --data 0x80 0x03 0x08 0x00 0x00 0x00 0x00 0x00 0x01 0x00
...
...
Response Message:
08 01 00 03 08 00 00 00 00 00 05 01 00
Check Dbus Property:
root@fp5280g2:/tmp# busctl get-property xyz.openbmc_project.LED.Controller.front_memory /xyz/openbmc_project/led/physical/front_memory xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.Off"
Set Attribute Value:
root@fp5280g2:/tmp# pldmtool raw --data 0x80 0x03 0x07 0x00 0x00 0x00 0x00 0x05 0x01 0x00 0x00 0x01 0x01
...
...
Response Message:
08 01 00 03 07 00 //exec successfully
Get Attribute Value By Handle:
root@fp5280g2:/tmp# pldmtool raw --data 0x80 0x03 0x08 0x00 0x00 0x00 0x00 0x00 0x01 0x00
...
...
Response Message:
08 01 00 03 08 00 00 00 00 00 05 01 01 // attribute value table was updated.
Check Dbus Property:
root@fp5280g2:/tmp# busctl get-property xyz.openbmc_project.LED.Controller.front_memory /xyz/openbmc_project/led/physical/front_memory xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.On" // dbus property was updated
Verified that string/integer attributes can be updated as expected.
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I8dab1870396061037284c1683de2502c8da68c98
diff --git a/libpldmresponder/bios.hpp b/libpldmresponder/bios.hpp
index 4a42bf4..d023ce9 100644
--- a/libpldmresponder/bios.hpp
+++ b/libpldmresponder/bios.hpp
@@ -85,6 +85,15 @@
* @return Response - PLDM Response message
*/
Response setDateTime(const pldm_msg* request, size_t payloadLength);
+
+ /** @brief Handler for setBIOSAttributeCurrentValue
+ *
+ * @param[in] request - Request message
+ * @param[in] payloadLength - Request message payload length
+ * @return Response - PLDM Response message
+ */
+ Response setBIOSAttributeCurrentValue(const pldm_msg* request,
+ size_t payloadLength);
};
} // namespace bios