oem_ibm: Implement timer for Surveillance Pings
This commit introduces a timer for surveillance pings sent by the
remote terminus to monitor the BMC. If a ping is not received
within 120 seconds, an informational error will be logged.
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: Ia52ed2461b2c2f8ea0102e60ed2a22c7691b2d2a
diff --git a/libpldmresponder/oem_handler.hpp b/libpldmresponder/oem_handler.hpp
index 2bcf36f..3b14ea8 100644
--- a/libpldmresponder/oem_handler.hpp
+++ b/libpldmresponder/oem_handler.hpp
@@ -113,6 +113,14 @@
/** @brief Interface to the process setEventReceiver*/
virtual void processSetEventReceiver() = 0;
+ /** @brief Interface to monitor the surveillance pings from remote terminus
+ *
+ * @param[in] tid - TID of the remote terminus
+ * @param[in] value - true or false, to indicate if the timer is
+ * running or not
+ * */
+ virtual void setSurvTimer(uint8_t tid, bool value) = 0;
+
virtual ~Handler() = default;
protected:
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 6c77159..2a19e66 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -360,7 +360,14 @@
rc = PLDM_SUCCESS;
if (oemPlatformHandler)
{
- oemPlatformHandler->resetWatchDogTimer();
+ if (oemPlatformHandler->watchDogRunning())
+ {
+ oemPlatformHandler->resetWatchDogTimer();
+ }
+ else
+ {
+ oemPlatformHandler->setSurvTimer(tid, true);
+ }
}
}
else