leakdetector: sdbusplus: use automatic signal emission Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7cddcd8ad78fc9796d417cb1ee5670001b5f1de6
diff --git a/src/leakdetector/LeakGPIODetector.cpp b/src/leakdetector/LeakGPIODetector.cpp index d6f1c5f..9ef133b 100644 --- a/src/leakdetector/LeakGPIODetector.cpp +++ b/src/leakdetector/LeakGPIODetector.cpp
@@ -46,15 +46,15 @@ DetectorIntf(ctx, getObjectPath(config.name), DetectorIntf::Definitions::properties_t{}, DetectorIntf::Detector::properties_t{ - config.name, DetectorState::Normal, config.type}), + config.name, DetectorState::Normal, config.type}, + DetectorIntf::signal_action::defer_emit), ctx(ctx), leakEvents(leakEvents), config(config), gpioInterface(ctx, config.name, config.pinName, (config.polarity == config::PinPolarity::activeLow), std::bind_front(&GPIODetector::updateGPIOStateAsync, this)) { - Detector::emit_added(); - createAssociations(); + DetectorIntf::emit_object_added(); ctx.spawn(gpioInterface.start()); @@ -73,8 +73,6 @@ associationList.emplace_back(association); associations(associationList); - - Definitions::emit_added(); } auto GPIODetector::updateGPIOStateAsync(bool gpioState)
diff --git a/src/leakdetector/LeakGPIODetector.hpp b/src/leakdetector/LeakGPIODetector.hpp index 8c27f0e..56ea3b9 100644 --- a/src/leakdetector/LeakGPIODetector.hpp +++ b/src/leakdetector/LeakGPIODetector.hpp
@@ -89,8 +89,8 @@ class GPIODetector : public DetectorIntf { public: - explicit GPIODetector(sdbusplus::async::context& ctx, Events& leakEvents, - const config::DetectorConfig& config); + GPIODetector(sdbusplus::async::context& ctx, Events& leakEvents, + const config::DetectorConfig& config); auto createAssociations() -> void;