diff options
author | Nikita Kosenkov <NKosenkov@IBS.RU> | 2022-08-26 18:58:55 +0300 |
---|---|---|
committer | Nikita Kosenkov <NKosenkov@IBS.RU> | 2022-08-26 18:58:55 +0300 |
commit | 2d080551eb07d137ca5cd0d2674564274ccb4a5b (patch) | |
tree | b609375ee540787c29c0e27ca90497c89e4a403b /src/dimm.cpp | |
parent | 8732a9fe648a72c5b17b119581c6d8dd8c0f1ae4 (diff) | |
download | smbios-mdrv1-2d080551eb07d137ca5cd0d2674564274ccb4a5b.tar.xz |
Add location and present setters
Diffstat (limited to 'src/dimm.cpp')
-rw-r--r-- | src/dimm.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/dimm.cpp b/src/dimm.cpp index 346c701..b25b0f8 100644 --- a/src/dimm.cpp +++ b/src/dimm.cpp @@ -109,11 +109,11 @@ uint32_t Dimm::memorySizeInKB(uint32_t value) void Dimm::dimmDeviceLocator(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn) { - std::string result; - - result = positionToString(positionNum, structLen, dataIn); + std::string result = positionToString(positionNum, structLen, dataIn); memoryDeviceLocator(result); + + locationCode(result); } std::string Dimm::memoryDeviceLocator(std::string value) @@ -170,11 +170,22 @@ uint16_t Dimm::maxMemorySpeedInMhz(uint16_t value) void Dimm::dimmManufacturer(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn) { - std::string result; + std::string result = positionToString(positionNum, structLen, dataIn); - 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); + functional(val); } std::string Dimm::manufacturer(std::string value) @@ -183,6 +194,12 @@ std::string Dimm::manufacturer(std::string value) Asset::manufacturer(value); } +bool Dimm::present(bool value) +{ + return sdbusplus::xyz::openbmc_project::Inventory::server::Item::present( + value); +} + void Dimm::dimmSerialNum(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn) { @@ -214,6 +231,12 @@ std::string Dimm::partNumber(std::string value) Asset::partNumber(value); } +std::string Dimm::locationCode(std::string value) +{ + return sdbusplus::xyz::openbmc_project::Inventory::Decorator::server:: + LocationCode::locationCode(value); +} + uint8_t Dimm::memoryAttributes(uint8_t value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: |