Un-expanded to expanded location code conversion
This commit implements an api to get expanded location code
from a given un-expanded location code and node number.
In case invalid argument is passed or the location code is
not found, corresponding error is returned to the caller.
Tested on simics.
To build use following command.
meson -Dibm-parser=enabled -Dvpd-manager=enabled build
ninja -C build
Sample bus call.
busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager
GetExpandedLocationCode sq <locationCode> <nodeNumber>.
Signed-off-by: SunnySrivastava1984 <sunnsr25@in.ibm.com>
Change-Id: I52654a1c34d25dc9b861159a2ae1d15379b44677
diff --git a/vpd-manager/manager.hpp b/vpd-manager/manager.hpp
index e5882b5..455cd11 100644
--- a/vpd-manager/manager.hpp
+++ b/vpd-manager/manager.hpp
@@ -104,7 +104,7 @@
getFRUsByExpandedLocationCode(const std::string locationCode);
/** @brief Implementation for GetExpandedLocationCode
- * An api to get expanded location code corresponding to a given
+ * An API to get expanded location code corresponding to a given
* un-expanded location code.
*
* @param[in] locationCode - Location code in un-expaned format.
@@ -136,6 +136,9 @@
// map to hold mapping to inventory path to vpd file path
// we need as map here as it is in reverse order to that of json
inventory::FrusMap frus;
+
+ // map to hold the mapping of location code and inventory path
+ inventory::LocationCodeMap fruLocationCode;
};
} // namespace manager