Get Present property for Dimms
From smbios file, for physically not present dimms details are filled
as "NO DIMM". Using which populating Present property under
xyz.openbmc_project.Inventory.Item interface with
true/false that indicates presence of dimms and making manufacturer
value empty for no dimm presence.
Tested:
Checked property is filled via dbus call.
Signed-off-by: Joshi-Mansi <mansi.joshi@linux.intel.com>
Change-Id: I84b05aeef3f77353fee1b663d39f3451c8faa337
diff --git a/src/dimm.cpp b/src/dimm.cpp
index 71123d2..a1763dc 100644
--- a/src/dimm.cpp
+++ b/src/dimm.cpp
@@ -171,7 +171,18 @@
{
std::string result = positionToString(positionNum, structLen, dataIn);
+ bool val = true;
+ if (result == "NO DIMM")
+ {
+ val = false;
+
+ // No dimm presence so making manufacturer value as "" (instead of
+ // NO DIMM - as there won't be any manufacturer for DIMM which is not
+ // present).
+ result = "";
+ }
manufacturer(result);
+ present(val);
}
std::string Dimm::manufacturer(std::string value)
@@ -180,6 +191,12 @@
Asset::manufacturer(value);
}
+bool Dimm::present(bool value)
+{
+ return sdbusplus::xyz::openbmc_project::Inventory::server::Item::present(
+ value);
+}
+
void Dimm::dimmSerialNum(const uint8_t positionNum, const uint8_t structLen,
uint8_t* dataIn)
{