add handler logic to handle i2c pcie commands
Add handler logic to manage the i2c pcie commands and their
corresponding data structure.
Tested: Only ran unit-tests (added new ones).
Change-Id: Ibd65d6745202dbf6bd67cd2cb480914ca6ae4ed1
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/handler.cpp b/handler.cpp
index 041f77b..341e195 100644
--- a/handler.cpp
+++ b/handler.cpp
@@ -257,6 +257,22 @@
return name;
}
+void Handler::buildI2cPcieMapping()
+{
+ _pcie_i2c_map = buildPcieMap();
+}
+
+size_t Handler::getI2cPcieMappingSize() const
+{
+ return _pcie_i2c_map.size();
+}
+
+std::tuple<std::uint32_t, std::string>
+ Handler::getI2cEntry(unsigned int entry) const
+{
+ return _pcie_i2c_map[entry];
+}
+
const std::string defaultConfigFile =
"/usr/share/ipmi-entity-association/entity_association_map.json";