Correction of VPD using ECC
ECC algorithm corrects VPD data in 32:1 bit ratio in the
event of corruption.
Main Test Cases:
1) Check correction of KW in records.
2) Check correction while writing and reading VPD.
3) Check for Module VPD correction.
Signed-off-by: Giridhari Krishna <giridharikrishnan@gmail.com>
Change-Id: I48a3db18df9d3a2aecde814610ab1b357e6f310d
diff --git a/vpd_tool_impl.cpp b/vpd_tool_impl.cpp
index 3926c75..753181d 100644
--- a/vpd_tool_impl.cpp
+++ b/vpd_tool_impl.cpp
@@ -50,8 +50,10 @@
Binary vpdVector{};
+ uint32_t vpdStartOffset = 0;
vpdVector = getVpdDataInVector(js, constants::systemVpdFilePath);
- ParserInterface* parser = ParserFactory::getParser(vpdVector, invPath);
+ ParserInterface* parser = ParserFactory::getParser(
+ vpdVector, invPath, constants::systemVpdFilePath, vpdStartOffset);
auto parseResult = parser->parse();
ParserFactory::freeParser(parser);
@@ -579,7 +581,17 @@
const std::string& inventoryPath =
jsonFile["frus"][fruPath][0]["inventoryPath"];
- Impl obj(completeVPDFile, (constants::pimPath + inventoryPath));
+ uint32_t vpdStartOffset = 0;
+ for (const auto& item : jsonFile["frus"][fruPath])
+ {
+ if (item.find("offset") != item.end())
+ {
+ vpdStartOffset = item["offset"];
+ }
+ }
+
+ Impl obj(completeVPDFile, (constants::pimPath + inventoryPath), fruPath,
+ vpdStartOffset);
std::string keywordVal = obj.readKwFromHw(recordName, keyword);
if (!keywordVal.empty())
@@ -1034,4 +1046,4 @@
<< "\nManufacturing reset on system vpd keywords is unsuccessful";
}
return 0;
-}
\ No newline at end of file
+}