summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--monitor/tach_sensor.cpp32
-rw-r--r--monitor/tach_sensor.hpp32
2 files changed, 6 insertions, 58 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,
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index dd2222b..4691d1e 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -130,48 +130,20 @@ class TachSensor
std::string getMatchString(const std::string& interface);
/**
- * @brief Callback function for a tach input properties
- * changed signal
- *
- * @param[in] msg - the dbus message
- * @param[in] data - user data
- * @param[in] err - dbus error
- */
- static int handleTachChangeSignal(sd_bus_message* msg,
- void* data,
- sd_bus_error* err);
-
- /**
- * @brief Callback function for a Target properties
- * changed signal
- *
- * @param[in] msg - the dbus message
- * @param[in] data - user data
- * @param[in] err - dbus error
- */
- static int handleTargetChangeSignal(sd_bus_message* msg,
- void* data,
- sd_bus_error* err);
-
- /**
* @brief Reads the Target property and stores in _tachTarget.
* Also calls Fan::tachChanged().
*
* @param[in] msg - the dbus message
- * @param[in] err - dbus error
*/
- void handleTargetChange(sdbusplus::message::message& msg,
- sd_bus_error* err);
+ void handleTargetChange(sdbusplus::message::message& msg);
/**
* @brief Reads the Value property and stores in _tachInput.
* Also calls Fan::tachChanged().
*
* @param[in] msg - the dbus message
- * @param[in] err - dbus error
*/
- void handleTachChange(sdbusplus::message::message& msg,
- sd_bus_error* err);
+ void handleTachChange(sdbusplus::message::message& msg);
/**
OpenPOWER on IntegriCloud