regulators: Add detectPhaseFaults() to Device
Add a detectPhaseFaults() method to the Device class. This method
executes the PhaseFaultDetection data member added in a previous commit.
Add a gtest test case to exercise the new code.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ie8a2bf7d1b60ebc29c256e8563e3e4808bb6a20e
diff --git a/phosphor-regulators/src/device.cpp b/phosphor-regulators/src/device.cpp
index da2f5ee..bde41cc 100644
--- a/phosphor-regulators/src/device.cpp
+++ b/phosphor-regulators/src/device.cpp
@@ -98,6 +98,20 @@
}
}
+void Device::detectPhaseFaults(Services& services, System& system,
+ Chassis& chassis)
+{
+ // Verify device is present
+ if (isPresent(services, system, chassis))
+ {
+ // If phase fault detection is defined for this device, execute it
+ if (phaseFaultDetection)
+ {
+ phaseFaultDetection->execute(services, system, chassis, *this);
+ }
+ }
+}
+
void Device::monitorSensors(Services& services, System& system,
Chassis& chassis)
{