Add support for power supply off when it should be on
If the power good bit indicates false, or the UNIT_IS_OFF bit is on,
create an error log and attach STATUS_WORD, STATUS_INPUT, STATUS_VOUT,
STATUS_IOUT, and MFR_SPECIFIC values to the metadata. The combination of
those PMBus command results should give an indication as to why the
power supply has turned off.
Change-Id: I692a8fdeac3fe208a5eb70964db7b5094cfb587c
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index 317c20b..e9bd9f3 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -96,6 +96,9 @@
/** @brief True if the power is on. */
bool powerOn = false;
+ /** @brief True if power on fault has been detected/reported. */
+ bool powerOnFault = false;
+
/** @brief The sd_event structure used by the power on timer. */
event::Event& event;
@@ -119,9 +122,7 @@
/** @brief Used to subscribe to D-Bus power on state changes **/
std::unique_ptr<sdbusplus::bus::match_t> powerOnMatch;
- /**
- * @brief Has a PMBus read failure already been logged?
- */
+ /** @brief Has a PMBus read failure already been logged? */
bool readFailLogged = false;
/**
@@ -140,7 +141,8 @@
*/
bool inputFault = false;
- /** @brief Callback for inventory property changes
+ /**
+ * @brief Callback for inventory property changes
*
* Process change of Present property for power supply.
*
@@ -166,7 +168,9 @@
*/
void updatePowerState();
- /** @brief Callback for power state property changes
+ /**
+ * @brief Callback for power state property changes
+ *
* Process changes to the powered on stat property for the system.
*
* @param[in] msg - Data associated with the power state signal