summaryrefslogtreecommitdiffstats
path: root/transporthandler.cpp
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2018-10-08 12:05:00 -0700
committerTom Joseph <tomjoseph@in.ibm.com>2018-10-18 14:47:54 +0000
commit1181af741589db873676f177ed85d6bc04884aa1 (patch)
treea3a950c7fbd553a9812fe2f258e4b6ca07af2b4a /transporthandler.cpp
parent3754442944d08235dc519c371d2222b53bca3fe3 (diff)
downloadphosphor-host-ipmid-1181af741589db873676f177ed85d6bc04884aa1.tar.gz
phosphor-host-ipmid-1181af741589db873676f177ed85d6bc04884aa1.zip
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>
Diffstat (limited to 'transporthandler.cpp')
-rw-r--r--transporthandler.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 43c88bb..9c42887 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -3,7 +3,6 @@
#include "app/channel.hpp"
#include "ipmid.hpp"
#include "net.hpp"
-#include "timer.hpp"
#include "utils.hpp"
#include <arpa/inet.h>
@@ -13,6 +12,7 @@
#include <fstream>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/timer.hpp>
#include <string>
#include <xyz/openbmc_project/Common/error.hpp>
@@ -36,7 +36,7 @@ namespace filesystem = std::experimental::filesystem;
#error filesystem not available
#endif
-extern std::unique_ptr<phosphor::ipmi::Timer> networkTimer;
+extern std::unique_ptr<phosphor::Timer> networkTimer;
const int SIZE_MAC = 18; // xx:xx:xx:xx:xx:xx
constexpr auto ipv4Protocol = "xyz.openbmc_project.Network.IP.Protocol.IPv4";
@@ -509,7 +509,7 @@ ipmi_ret_t ipmi_transport_set_lan(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
}
// start/restart the timer
- networkTimer->startTimer(networkTimeout);
+ networkTimer->start(networkTimeout);
}
else if (reqptr->data[0] == SET_IN_PROGRESS) // Set In Progress
{
@@ -955,8 +955,7 @@ void createNetworkTimer()
std::function<void()> networkTimerCallback(
std::bind(&commitNetworkChanges));
- networkTimer = std::make_unique<phosphor::ipmi::Timer>(
- ipmid_get_sd_event_connection(), networkTimerCallback);
+ networkTimer = std::make_unique<phosphor::Timer>(networkTimerCallback);
}
}
OpenPOWER on IntegriCloud