Don't use deprecated asio functions
This code used a number of asio functions that have been deprecated.
This patch replaces them with their new equivalents, and enabled
BOOST_ASIO_NO_DEPRECATED.
Change-Id: I98bddba4c7d72a53ceca9455429828e60f06c5e0
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/src/ExternalSensorMain.cpp b/src/ExternalSensorMain.cpp
index 627a4f6..2c10dc8 100644
--- a/src/ExternalSensorMain.cpp
+++ b/src/ExternalSensorMain.cpp
@@ -350,7 +350,8 @@
std::make_shared<boost::container::flat_set<std::string>>();
boost::asio::steady_timer reaperTimer(io);
- io.post([&objectServer, &sensors, &systemBus, &reaperTimer]() {
+ boost::asio::post(io,
+ [&objectServer, &sensors, &systemBus, &reaperTimer]() {
createSensors(objectServer, sensors, systemBus, nullptr, reaperTimer);
});
@@ -373,7 +374,7 @@
}
// this implicitly cancels the timer
- filterTimer.expires_from_now(std::chrono::seconds(1));
+ filterTimer.expires_after(std::chrono::seconds(1));
filterTimer.async_wait(
[&objectServer, &sensors, &systemBus, &sensorsChanged,