regulators: Add monitorSensors support to Device
Implemented the monitorSensors() method in the Device class. This method
reads the sensors for the voltage rails produced by the device.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I5ca48ba8d6ab2019c1840f3905d9603233b1881a
diff --git a/phosphor-regulators/src/device.cpp b/phosphor-regulators/src/device.cpp
index b1a136b..fd07d71 100644
--- a/phosphor-regulators/src/device.cpp
+++ b/phosphor-regulators/src/device.cpp
@@ -73,4 +73,14 @@
}
}
+void Device::monitorSensors(System& system, Chassis& chassis)
+{
+
+ // Monitor sensors in each rail
+ for (std::unique_ptr<Rail>& rail : rails)
+ {
+ rail->monitorSensors(system, chassis, *this);
+ }
+}
+
} // namespace phosphor::power::regulators
diff --git a/phosphor-regulators/src/device.hpp b/phosphor-regulators/src/device.hpp
index ab24e4b..e18f6fa 100644
--- a/phosphor-regulators/src/device.hpp
+++ b/phosphor-regulators/src/device.hpp
@@ -184,6 +184,17 @@
return isRegulatorDevice;
}
+ /**
+ * Monitors the sensors for the voltage rails produced by this device, if
+ * any.
+ *
+ * This method should be called once per second.
+ *
+ * @param system system that contains the chassis
+ * @param chassis chassis that contains the device
+ */
+ void monitorSensors(System& system, Chassis& chassis);
+
private:
/**
* Unique ID of this device.