Clear flags when the host changes to powered off state

When the host is powered off, the OCCs will be stopped, so clear any
reset pending flags as well as any outstanding HRESET requests.

This will ensure the next boot will start clean and not react to
something that happened on prior boot.

Tested on Rainier for several error scenarios.

Change-Id: Ie4156975a844e823787f7162ee0542d7f099bd12
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/pldm.hpp b/pldm.hpp
index 881061b..4d2873f 100644
--- a/pldm.hpp
+++ b/pldm.hpp
@@ -71,14 +71,18 @@
      *                                 state changes.
      *  @param[in] safeModeCallBack  - callBack handler to invoke when the
      *                                 system is in safe mode.
+     *  @param[in] poweredOffCallBack - callBack handler to invoke when the
+     *                                 host is powered off.
      */
     explicit Interface(
         std::function<bool(open_power::occ::instanceID, bool)>
             occActiveCallBack,
         std::function<void(open_power::occ::instanceID, bool)> sbeCallBack,
-        std::function<void(bool)> safeModeCallBack, EventPtr& event) :
+        std::function<void(bool)> safeModeCallBack,
+        std::function<void()> poweredOffCallBack, EventPtr& event) :
         occActiveCallBack(occActiveCallBack), sbeCallBack(sbeCallBack),
-        safeModeCallBack(safeModeCallBack), event(event),
+        safeModeCallBack(safeModeCallBack),
+        poweredOffCallBack(poweredOffCallBack), event(event),
         pldmEventSignal(
             open_power::occ::utils::getBus(),
             MatchRules::type::signal() +
@@ -205,6 +209,9 @@
      */
     std::function<void(bool)> safeModeCallBack = nullptr;
 
+    /** @brief Callback handler to be invoked when the host is powered off */
+    std::function<void()> poweredOffCallBack = nullptr;
+
     /** @brief reference to sd_event wrapped in unique_ptr */
     EventPtr& event;