summaryrefslogtreecommitdiffstats
path: root/monitor/tach_sensor.cpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-07-30 19:52:21 -0400
committerPatrick Williams <patrick@stwcx.xyz>2017-08-03 01:52:48 +0000
commit771659fcd288e40eda8fb80fe04f32b5d18d3599 (patch)
tree7506dee4a2e4b0c98a182d9f2fc48120f4af1202 /monitor/tach_sensor.cpp
parent78b58456c74b18d84ca55da1915ae6ffbb16476e (diff)
downloadphosphor-fan-presence-771659fcd288e40eda8fb80fe04f32b5d18d3599.tar.gz
phosphor-fan-presence-771659fcd288e40eda8fb80fe04f32b5d18d3599.zip
monitor: Remove static systemd match callbacks
Replace static systemd match callback wrappers with lamba methods. Change-Id: Ib8471478824d87483a60f527d29aa2d35ccb833f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'monitor/tach_sensor.cpp')
-rw-r--r--monitor/tach_sensor.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index 8d8d37a..9a98e37 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -107,8 +107,7 @@ TachSensor::TachSensor(sdbusplus::bus::bus& bus,
tachSignal = std::make_unique<sdbusplus::server::match::match>(
_bus,
match.c_str(),
- handleTachChangeSignal,
- this);
+ [this](auto& msg){ this->handleTachChange(msg); });
if (_hasTarget)
{
@@ -117,8 +116,7 @@ TachSensor::TachSensor(sdbusplus::bus::bus& bus,
targetSignal = std::make_unique<sdbusplus::server::match::match>(
_bus,
match.c_str(),
- handleTargetChangeSignal,
- this);
+ [this](auto& msg){ this->handleTargetChange(msg); });
}
}
@@ -131,26 +129,6 @@ std::string TachSensor::getMatchString(const std::string& interface)
}
-int TachSensor::handleTachChangeSignal(sd_bus_message* msg,
- void* usrData,
- sd_bus_error* err)
-{
- auto m = sdbusplus::message::message(msg);
- static_cast<TachSensor*>(usrData)->handleTachChange(m, err);
- return 0;
-}
-
-
-int TachSensor::handleTargetChangeSignal(sd_bus_message* msg,
- void* usrData,
- sd_bus_error* err)
-{
- auto m = sdbusplus::message::message(msg);
- static_cast<TachSensor*>(usrData)->handleTargetChange(m, err);
- return 0;
-}
-
-
/**
* @brief Reads a property from the input message and stores it in value.
* T is the value type.
@@ -184,8 +162,7 @@ static void readPropertyFromMessage(sdbusplus::message::message& msg,
}
-void TachSensor::handleTargetChange(sdbusplus::message::message& msg,
- sd_bus_error* err)
+void TachSensor::handleTargetChange(sdbusplus::message::message& msg)
{
readPropertyFromMessage(msg,
FAN_SENSOR_CONTROL_INTF,
@@ -197,8 +174,7 @@ void TachSensor::handleTargetChange(sdbusplus::message::message& msg,
}
-void TachSensor::handleTachChange(sdbusplus::message::message& msg,
- sd_bus_error* err)
+void TachSensor::handleTachChange(sdbusplus::message::message& msg)
{
readPropertyFromMessage(msg,
FAN_SENSOR_VALUE_INTF,
OpenPOWER on IntegriCloud