Get Inventory list using unexpanded location code
This commit implements an api to get inventory list with respect to
a given location code in un-expanded format.
Along with location code node also needs to be passed.
In case no inventory is found at the given location or location code
is not correct, corresponding error is returned to the caller.
Tested on simics.
This api is under com.ibm.vpd.Manager interface. So vpd-manager app
needs to be running for this api to work.
Sample command for simics:
busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager
GetFRUsByUnexpandedLocationCode sq <location_code> <node_number>
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: I87159d2a3c293e82c9e82d21a9d281bd176a30e7
diff --git a/types.hpp b/types.hpp
index bab4569..0c02fd9 100644
--- a/types.hpp
+++ b/types.hpp
@@ -37,8 +37,8 @@
using FrusMap =
std::unordered_map<Path, std::pair<VPDfilepath, FruIsMotherboard>>;
using LocationCode = std::string;
-using LocationCodeMap = std::unordered_map<Path, LocationCode>;
-
+using LocationCodeMap = std::unordered_multimap<LocationCode, Path>;
+using ListOfPaths = std::vector<sdbusplus::message::object_path>;
using namespace std::string_literals;
constexpr auto pimPath = "/xyz/openbmc_project/inventory";
constexpr auto pimIntf = "xyz.openbmc_project.Inventory.Manager";