regulators: Add monitorSensors support to Chassis
Implemented the monitorSensors() method in the Chassis class. This method
reads the sensors for the voltage rails produced by the chassis.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: Idb283b09c645983190601e030334399ee76c1995
diff --git a/phosphor-regulators/src/chassis.cpp b/phosphor-regulators/src/chassis.cpp
index a0d0c2b..29ebb79 100644
--- a/phosphor-regulators/src/chassis.cpp
+++ b/phosphor-regulators/src/chassis.cpp
@@ -55,4 +55,13 @@
}
}
+void Chassis::monitorSensors(System& system)
+{
+ // Monitor sensors in each device
+ for (std::unique_ptr<Device>& device : devices)
+ {
+ device->monitorSensors(system, *this);
+ }
+}
+
} // namespace phosphor::power::regulators
diff --git a/phosphor-regulators/src/chassis.hpp b/phosphor-regulators/src/chassis.hpp
index 3fd3792..4423926 100644
--- a/phosphor-regulators/src/chassis.hpp
+++ b/phosphor-regulators/src/chassis.hpp
@@ -122,6 +122,16 @@
return number;
}
+ /**
+ * Monitors the sensors for the voltage rails produced by this chassis, if
+ * any.
+ *
+ * This method should be called once per second.
+ *
+ * @param system system that contains the chassis
+ */
+ void monitorSensors(System& system);
+
private:
/**
* Chassis number within the system.