summaryrefslogtreecommitdiffstats
path: root/mainloop.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2018-04-18 14:53:01 -0500
committerMatthew Barth <msbarth@us.ibm.com>2018-04-27 15:09:25 -0500
commit358193811e9769851e7f04816c3f5938f5a64f64 (patch)
tree86e371f05910e165d0f674d9738be2951be43531 /mainloop.cpp
parentd238e2325e4791af8a2823f1cf4cc3a3002a504f (diff)
downloadphosphor-hwmon-358193811e9769851e7f04816c3f5938f5a64f64.tar.gz
phosphor-hwmon-358193811e9769851e7f04816c3f5938f5a64f64.zip
Add status interface to sensors
When a fault sysfs file is present for a sensor, the OperationalStatus interface is attached to the sensor object. The functional property is initially set to the corresponding value read from the fault sysfs file when the sensor object is created. A follow-up commit will address updating the functional property based on reading the fault sysfs file during the polling interval. Tested: OperationalStatus interface created for sensors with fault files Interface not created for sensors without fault file Functional property set to correct value from sensor's fault file Change-Id: Id75b3711d048d4667d2173a3255512cf5482ab67 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'mainloop.cpp')
-rw-r--r--mainloop.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mainloop.cpp b/mainloop.cpp
index c18ae7f..a9898b7 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -33,6 +33,7 @@
#include "mainloop.hpp"
#include "targets.hpp"
#include "thresholds.hpp"
+#include "sensor.hpp"
#include <xyz/openbmc_project/Sensor/Device/error.hpp>
@@ -357,6 +358,9 @@ optional_ns::optional<ObjectStateData> MainLoop::getObject(
}
addTarget<hwmon::FanPwm>(sensor.first, ioAccess, _devPath, info);
+ // Add status interface based on _fault file being present
+ sensor::addStatus(sensor.first, ioAccess, _devPath, info);
+
// All the interfaces have been created. Go ahead
// and emit InterfacesAdded.
valueInterface->emit_object_added();
OpenPOWER on IntegriCloud