API to update planar IM to P11 series
This commit implements an API to update the IM value in planar EEPROM to
P11 series(6000x).
Change-Id: Iedfcba0eee278ee13bfdf8ef26eb1a894424e743
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/include/single_fab.hpp b/vpd-manager/include/single_fab.hpp
index 0e456e8..c5623c4 100644
--- a/vpd-manager/include/single_fab.hpp
+++ b/vpd-manager/include/single_fab.hpp
@@ -45,5 +45,15 @@
* @return true, if field mode is enabled. otherwise false.
*/
bool isFieldModeEnabled() const noexcept;
+
+ /**
+ * @brief API to update IM value on system planar EEPROM path to P11 series.
+ *
+ * @param[in] i_currentImValuePlanar - current IM value in planar EEPROM.
+ *
+ * @return true if IM value is updated successfully, otherwise false.
+ */
+ bool updateSystemImValueInVpdToP11Series(
+ std::string i_currentImValuePlanar) const noexcept;
};
} // namespace vpd
diff --git a/vpd-manager/src/single_fab.cpp b/vpd-manager/src/single_fab.cpp
index 5cf8602..d28f555 100644
--- a/vpd-manager/src/single_fab.cpp
+++ b/vpd-manager/src/single_fab.cpp
@@ -132,4 +132,19 @@
return false;
}
+
+bool SingleFab::updateSystemImValueInVpdToP11Series(
+ std::string i_currentImValuePlanar) const noexcept
+{
+ bool l_retVal{false};
+ if (!i_currentImValuePlanar.empty())
+ {
+ // update the IM value to P11 series(6000x). Replace the first character
+ // of IM value string with '6'
+ l_retVal = setImOnPlanar(i_currentImValuePlanar.replace(
+ constants::VALUE_0, constants::VALUE_1,
+ std::to_string(constants::VALUE_6)));
+ }
+ return l_retVal;
+}
} // namespace vpd