From ec613db1206ffedc78971098a2567b88e532c5b6 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Thu, 8 Jun 2017 12:12:53 -0400 Subject: presence: Use new sdbusplus wrapper Use the sdbusplus wrapper methods introduced previously. Change-Id: Ifd431753e9513436a9b5ab98cc49d907a5929c20 Signed-off-by: Brad Bishop --- presence/tach_detect.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'presence/tach_detect.cpp') diff --git a/presence/tach_detect.cpp b/presence/tach_detect.cpp index 2449f82..dc6356a 100644 --- a/presence/tach_detect.cpp +++ b/presence/tach_detect.cpp @@ -14,16 +14,14 @@ * limitations under the License. */ #include -#include #include "fan_enclosure.hpp" #include "fan_detect_defs.hpp" +#include "sdbusplus.hpp" #include "tach_sensor.hpp" int main(void) { - auto bus = sdbusplus::bus::new_default(); - std::vector> fans; for (auto const& detectMap: fanDetectMap) @@ -33,13 +31,11 @@ int main(void) for (auto const& fanProp: detectMap.second) { auto fan = std::make_unique< - phosphor::fan::presence::FanEnclosure>(bus, - fanProp); + phosphor::fan::presence::FanEnclosure>(fanProp); for (auto const &fanSensor: std::get<2>(fanProp)) { auto sensor = std::make_unique< - phosphor::fan::presence::TachSensor>(bus, - fanSensor, + phosphor::fan::presence::TachSensor>(fanSensor, *fan); fan->addSensor(std::move(sensor)); } @@ -50,9 +46,10 @@ int main(void) while (true) { + using namespace phosphor::fan::util; // Respond to dbus signals - bus.process_discard(); - bus.wait(); + SDBusPlus::getBus().process_discard(); + SDBusPlus::getBus().wait(); } return 0; } -- cgit v1.2.1