From bfcaf3d8c9de49453d85a2cbaf65e4fe276512d8 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Wed, 25 Apr 2018 15:05:58 -0500 Subject: Refresh sensor functional state During the monitoring loop, the associated fault file of a sensor is read and its functional status is updated prior to reading the sensor's input file. Tested: The functional property is updated according to its fault file Resolves: openbmc/openbmc#2329 Change-Id: Icc28e914df79c6681d45e92a5ea4054704ad8efd Signed-off-by: Matthew Barth --- mainloop.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mainloop.cpp b/mainloop.cpp index 9944e09..11b182e 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -532,9 +532,15 @@ void MainLoop::read() auto it = obj.find(InterfaceType::STATUS); if (it != obj.end()) { + auto fault = ioAccess.read( + i.first.first, + i.first.second, + hwmon::entry::fault, + hwmonio::retries, + hwmonio::delay); auto statusIface = std::experimental::any_cast< std::shared_ptr>(it->second); - if (!statusIface->functional()) + if (!statusIface->functional((fault == 0) ? true : false)) { continue; } -- cgit v1.2.1