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_string_attribute.cpp b/libpldmresponder/bios_string_attribute.cpp
index 1453644..19819c9 100644
--- a/libpldmresponder/bios_string_attribute.cpp
+++ b/libpldmresponder/bios_string_attribute.cpp
@@ -129,6 +129,24 @@
     return PLDM_SUCCESS;
 }
 
+void BIOSStringAttribute::generateAttributeEntry(
+    const std::variant<int64_t, std::string>& attributevalue,
+    Table& attrValueEntry)
+{
+    std::string value = std::get<std::string>(attributevalue);
+    uint16_t len = value.size();
+
+    attrValueEntry.resize(sizeof(pldm_bios_attr_val_table_entry) +
+                          sizeof(uint16_t) + len - 1);
+
+    auto entry = reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+        attrValueEntry.data());
+
+    entry->attr_type = 1;
+    memcpy(entry->value, &len, sizeof(uint16_t));
+    memcpy(entry->value + sizeof(uint16_t), value.c_str(), value.size());
+}
+
 } // namespace bios
 } // namespace responder
 } // namespace pldm