regulators: Add monitorSensors support to System
Implemented the monitorSensors() method in the System class. This method
reads the sensors for the voltage rails produced by the system.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: Ied2248c362708aa77c1efd31abff0cf023211a7e
diff --git a/phosphor-regulators/src/system.cpp b/phosphor-regulators/src/system.cpp
index 29dad5e..d3b599a 100644
--- a/phosphor-regulators/src/system.cpp
+++ b/phosphor-regulators/src/system.cpp
@@ -52,4 +52,13 @@
}
}
+void System::monitorSensors()
+{
+ // Monitor sensors in each chassis
+ for (std::unique_ptr<Chassis>& oneChassis : chassis)
+ {
+ oneChassis->monitorSensors(*this);
+ }
+}
+
} // namespace phosphor::power::regulators
diff --git a/phosphor-regulators/src/system.hpp b/phosphor-regulators/src/system.hpp
index 46c3d7c..f678658 100644
--- a/phosphor-regulators/src/system.hpp
+++ b/phosphor-regulators/src/system.hpp
@@ -105,6 +105,14 @@
return rules;
}
+ /**
+ * Monitors the sensors for the voltage rails produced by this system, if
+ * any.
+ *
+ * This method should be called once per second.
+ */
+ void monitorSensors();
+
private:
/**
* Builds the IDMap for the system.