diff options
Diffstat (limited to 'sensordatahandler.cpp')
-rw-r--r-- | sensordatahandler.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp index 231822b..aca81c7 100644 --- a/sensordatahandler.cpp +++ b/sensordatahandler.cpp @@ -154,6 +154,42 @@ GetSensorResponse assertion(const Info& sensorInfo) sensorInfo.sensorInterface); } +GetSensorResponse eventdata2(const Info& sensorInfo) +{ + sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()}; + GetSensorResponse response {}; + auto responseData = reinterpret_cast<GetReadingResponse*>(response.data()); + + auto service = ipmi::getService(bus, + sensorInfo.sensorInterface, + sensorInfo.sensorPath); + + const auto& interfaceList = sensorInfo.propertyInterfaces; + + for (const auto& interface : interfaceList) + { + for (const auto& property : interface.second) + { + auto propValue = ipmi::getDbusProperty(bus, + service, + sensorInfo.sensorPath, + interface.first, + property.first); + + for (const auto& value : property.second) + { + if (propValue == value.second.assert) + { + setReading(value.first, responseData); + break; + } + } + } + } + + return response; +} + } //namespace get namespace set |