regulators: Add monitorSensors support to Rail
Implemented the monitorSensors() method in the Rail class. This method
reads the sensors for a voltage rail.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: Ifbe6461349d20fee1eba233844c95c1046e1a54a
diff --git a/phosphor-regulators/src/rail.cpp b/phosphor-regulators/src/rail.cpp
index e95b396..7d90e77 100644
--- a/phosphor-regulators/src/rail.cpp
+++ b/phosphor-regulators/src/rail.cpp
@@ -32,4 +32,13 @@
}
}
+void Rail::monitorSensors(System& system, Chassis& chassis, Device& device)
+{
+ // If sensor monitoring is defined for this rail, read the sensors.
+ if (sensorMonitoring)
+ {
+ sensorMonitoring->execute(system, chassis, device, *this);
+ }
+}
+
} // namespace phosphor::power::regulators