bios_table: Implement find attr entry by string handle
Implement find attribute table entry by string handle
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I884043df1b75e48d737bb37b8f0f724c32bb3334
diff --git a/libpldmresponder/bios_table.cpp b/libpldmresponder/bios_table.cpp
index 3f5d532..b8fa713 100644
--- a/libpldmresponder/bios_table.cpp
+++ b/libpldmresponder/bios_table.cpp
@@ -140,6 +140,13 @@
handle);
}
+const pldm_bios_attr_table_entry* findByStringHandle(const Table& table,
+ uint16_t handle)
+{
+ return pldm_bios_table_attr_find_by_string_handle(table.data(),
+ table.size(), handle);
+}
+
const pldm_bios_attr_table_entry*
constructStringEntry(Table& table,
pldm_bios_table_attr_entry_string_info* info)
diff --git a/libpldmresponder/bios_table.hpp b/libpldmresponder/bios_table.hpp
index cb1873c..52385e5 100644
--- a/libpldmresponder/bios_table.hpp
+++ b/libpldmresponder/bios_table.hpp
@@ -197,6 +197,14 @@
const pldm_bios_attr_table_entry* findByHandle(const Table& table,
uint16_t handle);
+/** @brief Find attribute entry by string handle
+ * @param[in] table - attribute table
+ * @param[in] handle - string handle
+ * @return Pointer to the attribute table entry
+ */
+const pldm_bios_attr_table_entry* findByStringHandle(const Table& table,
+ uint16_t handle);
+
/** @struct StringField
* @brief String field of attribute table
*/