Update analyze function to check STATUS_WORD
The STATUS_WORD PMBus command response will be the start of the power
supply fault analysis. Update the analyze() function to read its value
and process (select) fault bits.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: If7274ad237c0604a56008676ae64804a5fd2854e
diff --git a/phosphor-power-supply/util.hpp b/phosphor-power-supply/util.hpp
new file mode 100644
index 0000000..2e4afe2
--- /dev/null
+++ b/phosphor-power-supply/util.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "util_base.hpp"
+#include "utility.hpp"
+
+namespace phosphor::power::psu
+{
+
+class Util : public UtilBase
+{
+ public:
+ //~Util(){};
+ bool getPresence(sdbusplus::bus::bus& bus,
+ const std::string& invpath) const override
+ {
+ bool present = false;
+
+ // Use getProperty utility function to get presence status.
+ util::getProperty(INVENTORY_IFACE, PRESENT_PROP, invpath,
+ INVENTORY_MGR_IFACE, bus, present);
+
+ return present;
+ }
+};
+
+} // namespace phosphor::power::psu