Grab DBus connection
Connect to DBus and own a busname.
Create a freedesktop ObjectManager.
Change-Id: I186dadc5a5172f44edf9cfc8d0a338677636de04
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/mainloop.hpp b/mainloop.hpp
index 2d2cea2..23ee683 100644
--- a/mainloop.hpp
+++ b/mainloop.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <string>
+#include <sdbusplus/server.hpp>
/** @class MainLoop
* @brief hwmon-readd main application loop.
@@ -17,6 +18,7 @@
/** @brief Constructor
*
+ * @param[in] bus - sdbusplus bus client connection.
* @param[in] path - hwmon sysfs instance to manage
* @param[in] prefix - DBus busname prefix.
* @param[in] root - DBus sensors namespace root.
@@ -28,6 +30,7 @@
* the format <prefix>.hwmon<n>.
*/
MainLoop(
+ sdbusplus::bus::bus&& bus,
const std::string& path,
const char* prefix,
const char* root);
@@ -42,7 +45,10 @@
void shutdown() noexcept;
private:
-
+ /** @brief sdbusplus bus client connection. */
+ sdbusplus::bus::bus _bus;
+ /** @brief sdbusplus freedesktop.ObjectManager storage. */
+ sdbusplus::server::manager::manager _manager;
/** @brief Shutdown requested. */
volatile bool _shutdown;
/** @brief Path to hwmon sysfs instance. */