BIOS: Implement attribute value table with type string
Construct attribute value table with type string based on string table
and attribute table.
Change-Id: I40c782ae8753340c964cf067e53e7947b18e9e35
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>
diff --git a/libpldmresponder/bios_parser.hpp b/libpldmresponder/bios_parser.hpp
index 2edbc95..8b0c46e 100644
--- a/libpldmresponder/bios_parser.hpp
+++ b/libpldmresponder/bios_parser.hpp
@@ -124,6 +124,12 @@
sizeof(uint16_t) + sizeof(uint8_t) +
sizeof(uint16_t) + sizeof(uint16_t) +
sizeof(uint16_t));
+/* attrValueTableSize is the sum of fixed length of members which construct a
+ * string attribute value table, including attr_handle(uint16_t),
+ * attr_type(uint8_t), CurrentStringLength(uint16_t)*/
+constexpr auto attrValueTableSize = 5;
+static_assert(attrValueTableSize ==
+ sizeof(uint16_t) + sizeof(uint8_t) + sizeof(uint16_t));
/** @brief Get the string related values and the default values for the
* BIOSString and BIOSStringReadOnly types
@@ -133,6 +139,14 @@
*/
const AttrValuesMap& getValues();
+/** @brief Get the current values for the BIOS Attribute
+ *
+ * @param[in] attrName - BIOS attribute name
+ *
+ * @return BIOS attribute value
+ */
+std::string getAttrValue(const AttrName& attrName);
+
} // namespace bios_string
} // namespace bios_parser