diff options
author | Oskar Senft <osk@google.com> | 2018-12-04 22:43:19 -0500 |
---|---|---|
committer | Oskar Senft <osk@google.com> | 2018-12-17 20:47:22 +0000 |
commit | 40f59e2c50572705496ae743577f124f24afd77e (patch) | |
tree | 319fac997bb5cb35f3ec80cf1b61645775fa3e69 /ipmi_fru_info_area.cpp | |
parent | 9d7251c623a66e9138b88148b998250c1c30d67b (diff) | |
download | phosphor-host-ipmid-40f59e2c50572705496ae743577f124f24afd77e.tar.gz phosphor-host-ipmid-40f59e2c50572705496ae743577f124f24afd77e.zip |
ipmi_fru_info_area: Add support for chassis type
Change-Id: Ifd89fb37dc8515757d6014edeb028eb25e37bb95
Signed-off-by: Oskar Senft <osk@google.com>
Diffstat (limited to 'ipmi_fru_info_area.cpp')
-rw-r--r-- | ipmi_fru_info_area.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/ipmi_fru_info_area.cpp b/ipmi_fru_info_area.cpp index 949d546..e10eee5 100644 --- a/ipmi_fru_info_area.cpp +++ b/ipmi_fru_info_area.cpp @@ -20,6 +20,7 @@ static constexpr auto buildDate = "BuildDate"; static constexpr auto model = "Model"; static constexpr auto prettyName = "PrettyName"; static constexpr auto version = "Version"; +static constexpr auto type = "Type"; // Board info areas static constexpr auto board = "Board"; @@ -111,6 +112,25 @@ void postFormatProcessing(FruAreaData& data) } /** + * @brief Read chassis type property value from inventory and append to the FRU + * area data. + * + * @param[in] propMap map of property values + * @param[in,out] data FRU area data to be appended + */ +void appendChassisType(const PropertyMap& propMap, FruAreaData& data) +{ + uint8_t chassisType = 0; // Not specified + auto iter = propMap.find(type); + if (iter != propMap.end()) + { + auto value = iter->second; + chassisType = std::stoi(value); + } + data.emplace_back(chassisType); +} + +/** * @brief Read property value from inventory and append to the FRU area data * * @param[in] key key to search for in the property inventory data @@ -239,7 +259,7 @@ FruAreaData buildChassisInfoArea(const PropertyMap& propMap) preFormatProcessing(false, fruAreaData); // chassis type - fruAreaData.emplace_back(0); + appendChassisType(propMap, fruAreaData); // Chasiss part number, in config.yaml it is configured as model appendData(model, propMap, fruAreaData); |