pseq: Add setPowerSupplyError D-Bus method
Add a setPowerSupplyError method to the org.openbmc.control.Power
D-Bus interface. When a power supply error is detected which is severe
enough to cause a power good failure, that error should be used in
preference to the power good error. Add a D-Bus method to allow this to
be communicated between the applications. The parameter passed should
be the power supply error to log, for example
"xyz.openbmc_project.Power.PowerSupply.Error.PSKillFault".
Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: I8500ace4638236dda2d7ff4361b61efa30a50ac1
diff --git a/phosphor-power-sequencer/src/power_interface.hpp b/phosphor-power-sequencer/src/power_interface.hpp
index d189120..0a3dae0 100644
--- a/phosphor-power-sequencer/src/power_interface.hpp
+++ b/phosphor-power-sequencer/src/power_interface.hpp
@@ -79,6 +79,16 @@
*/
virtual void setState(int state) = 0;
+ /**
+ * Sets the power supply error. The error should be of great enough severity
+ * that a power good failure may occur and will be issued in preference to
+ * the power good error.
+ * @param[in] error power supply error. The value should be a message
+ * argument for a phosphor-logging Create call, e.g.
+ * "xyz.openbmc_project.Power.PowerSupply.Error.PSKillFault"
+ */
+ virtual void setPowerSupplyError(const std::string& error) = 0;
+
private:
/**
* Holder for the instance of this interface to be on dbus
@@ -133,6 +143,12 @@
sd_bus_error* error);
/**
+ * Systemd bus callback for the setPowerSupplyError method
+ */
+ static int callbackSetPowerSupplyError(sd_bus_message* msg, void* context,
+ sd_bus_error* error);
+
+ /**
* Systemd bus callback for the setPowerState method
*/
static int callbackSetPowerState(sd_bus_message* msg, void* context,