summaryrefslogtreecommitdiffstats
path: root/presence/tach_detect.cpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-08 12:12:53 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-07-08 16:52:38 -0400
commitec613db1206ffedc78971098a2567b88e532c5b6 (patch)
tree936b365bfff1c334b211dcb23950ee8b480c1117 /presence/tach_detect.cpp
parent6e9cfdb7cc15539bc7e7589c8284c4e2eebf08fe (diff)
downloadphosphor-fan-presence-ec613db1206ffedc78971098a2567b88e532c5b6.tar.gz
phosphor-fan-presence-ec613db1206ffedc78971098a2567b88e532c5b6.zip
presence: Use new sdbusplus wrapper
Use the sdbusplus wrapper methods introduced previously. Change-Id: Ifd431753e9513436a9b5ab98cc49d907a5929c20 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'presence/tach_detect.cpp')
-rw-r--r--presence/tach_detect.cpp15
1 files changed, 6 insertions, 9 deletions
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 <vector>
-#include <sdbusplus/bus.hpp>
#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<std::unique_ptr<phosphor::fan::presence::FanEnclosure>> 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;
}
OpenPOWER on IntegriCloud