Add routines to start and stop the sd_event timer

Change-Id: I738be7b70554125e544aa59fe1770e909d3dffb1
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index 11298ab..49b6f26 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -13,7 +13,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include <chrono>
+#include <phosphor-logging/log.hpp>
 #include "softoff.hpp"
+#include "config.h"
 namespace phosphor
 {
 namespace ipmi
@@ -22,6 +25,7 @@
 /** @brief Send the SMS_ATN to host if value is set */
 void SoftPowerOff::sendSMSAttn()
 {
+    using namespace std::chrono;
     auto method = bus.new_method_call(HOST_IPMI_BUS,
                                       HOST_IPMI_OBJ,
                                       HOST_IPMI_INTF,
@@ -31,6 +35,14 @@
     // BT returns '0' on success and bus_error on failure.
     bus.call_noreply(method);
 
+    // Start the timer
+    auto time = duration_cast<microseconds>(
+            seconds(IPMI_SMS_ATN_ACK_TIMEOUT_SECS));
+    auto r = timer.startTimer(time);
+    if (r < 0)
+    {
+        throw std::runtime_error("Error starting timer");
+    }
     return;
 }