bios: Implement BIOSAttribute
BIOS tables are built based on json entry. When a bios attribute
is set by pldm, the corresponding dbus backend should be synchronized.
Then, the BIOSAttribute class is abstracted, and it provides the following two
interfaces
1. constructEntry: Construct the entry of the attribute/attribute-value table
2. setAttrValueOnDbus: Update the corresponding dbus backend
Specific types of attributes are implemented based on BIOSAttribute. eg
BIOSStringAttribute, BIOSEnumAttribute, BIOSIntegerAttribute.
Once the BIOS Handler is loaded, all attributes would be constructed from json.
We use BIOSConfig(class) to persist all attributes in ram.
BIOSConfig provides the following methods.
- buildTables: Build tables
- removeTables: Remove the persistent tables
- setAttrValue: Set attribute value on dbus and update the bios table
- getBIOSTable: Get bios table by table type
After we implemented BIOSConfig/BIOSSIntegerAttribute/BIOSStringAttribute/BIOSEnumAttribute,
we will use the new interface(BIOSConfig) in BIOS Handler.
It will have the following advantages
1. Different types of attribute implementations are placed in different files, improving readability
2. Logic to operate bios tables is no longer coupled with BIOS Handler.
In addition, added a c++ wrapper for string table. After
completing this refactor, will move the implementation to a common
place. It's useful for pldmtool.
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I11e304c470360ca5fde23e4969494bb03de475c0
diff --git a/test/meson.build b/test/meson.build
index 1ae6058..a7bd88f 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -19,6 +19,7 @@
tests = [
'libpldmresponder_base_test',
'libpldmresponder_bios_test',
+ 'libpldmresponder_bios_attribute_test',
'libpldmresponder_pdr_state_effecter_test',
'libpldmresponder_bios_table_test',
'libpldmresponder_platform_test',