psu-ng: Create error for communication fault
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I3f147063759559bf2486e78d9873c6d464381ddd
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 32847b8..b7f8caa 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -226,6 +226,18 @@
psu->setFaultLogged();
}
+ else if (psu->hasCommFault())
+ {
+ /* Attempts to communicate with the power supply have reached
+ * there limit. Create an error. */
+ additionalData["CALLOUT_DEVICE_PATH"] = psu->getDevicePath();
+
+ createError(
+ "xyz.openbmc_project.Power.PowerSupply.Error.CommFault",
+ additionalData);
+
+ psu->setFaultLogged();
+ }
}
}
}