Use the common timer class

The common timer class from sdbusplus offers all the timer goodness that
we currently use. The unit test is also no longer needed (and has been
added to sdbusplus's version of the timer.hpp implementation).

Change-Id: I278817489433a29ca739f70fdacd8bb897797d66
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/chassishandler.cpp b/chassishandler.cpp
index dab62c4..d75b3b2 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -4,7 +4,6 @@
 
 #include "ipmid.hpp"
 #include "settings.hpp"
-#include "timer.hpp"
 #include "types.hpp"
 #include "utils.hpp"
 
@@ -25,6 +24,7 @@
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
+#include <sdbusplus/timer.hpp>
 #include <sstream>
 #include <string>
 #include <xyz/openbmc_project/Common/error.hpp>
@@ -49,13 +49,11 @@
 
 // Defines
 #define SET_PARM_VERSION 0x01
-#define SET_PARM_BOOT_FLAGS_PERMANENT 0x40      // boot flags data1 7th bit on
-#define SET_PARM_BOOT_FLAGS_VALID_ONE_TIME 0x80 // boot flags data1 8th bit on
-#define SET_PARM_BOOT_FLAGS_VALID_PERMANENT                                    \
-    0xC0 // boot flags data1 7 & 8 bit
-         // on
+#define SET_PARM_BOOT_FLAGS_PERMANENT 0x40
+#define SET_PARM_BOOT_FLAGS_VALID_ONE_TIME 0x80
+#define SET_PARM_BOOT_FLAGS_VALID_PERMANENT 0xC0
 
-std::unique_ptr<phosphor::ipmi::Timer> identifyTimer = nullptr;
+std::unique_ptr<phosphor::Timer> identifyTimer = nullptr;
 
 constexpr size_t SIZE_MAC = 18;
 constexpr size_t SIZE_BOOT_OPTION = (uint8_t)
@@ -1177,8 +1175,8 @@
 {
     if (!identifyTimer)
     {
-        identifyTimer = std::make_unique<phosphor::ipmi::Timer>(
-            ipmid_get_sd_event_connection(), enclosureIdentifyLedOff);
+        identifyTimer =
+            std::make_unique<phosphor::Timer>(enclosureIdentifyLedOff);
     }
 }
 
@@ -1205,7 +1203,7 @@
     {
         // stop the timer if already started, for force identify we should
         // not turn off LED
-        identifyTimer->setTimer(SD_EVENT_OFF);
+        identifyTimer->stop();
         try
         {
             enclosureIdentifyLed(true);
@@ -1223,11 +1221,11 @@
         // start the timer
         auto time = std::chrono::duration_cast<std::chrono::microseconds>(
             std::chrono::seconds(identifyInterval));
-        identifyTimer->startTimer(time);
+        identifyTimer->start(time);
     }
     else if (!identifyInterval)
     {
-        identifyTimer->setTimer(SD_EVENT_OFF);
+        identifyTimer->stop();
         enclosureIdentifyLedOff();
     }
     return IPMI_CC_OK;