Make the dbushelper own its own bus handle.

The dbushelper implements an interface that should not be sdbusplus
specific. By making the implementation own the sdbusplus aspects, an
alternate implementation can be swapped in.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I4109772499421e2e6497a0fcad663ebbd1210a7c
diff --git a/dbus/dbushelper.cpp b/dbus/dbushelper.cpp
index cb847e6..f8f087d 100644
--- a/dbus/dbushelper.cpp
+++ b/dbus/dbushelper.cpp
@@ -44,9 +44,9 @@
                                    const std::string& path)
 {
     auto mapper =
-        bus.new_method_call("xyz.openbmc_project.ObjectMapper",
-                            "/xyz/openbmc_project/object_mapper",
-                            "xyz.openbmc_project.ObjectMapper", "GetObject");
+        _bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+                             "/xyz/openbmc_project/object_mapper",
+                             "xyz.openbmc_project.ObjectMapper", "GetObject");
 
     mapper.append(path);
     mapper.append(std::vector<std::string>({intf}));
@@ -55,7 +55,7 @@
 
     try
     {
-        auto responseMsg = bus.call(mapper);
+        auto responseMsg = _bus.call(mapper);
 
         responseMsg.read(response);
     }
@@ -79,8 +79,8 @@
                                const std::string& path,
                                struct SensorProperties* prop)
 {
-    auto pimMsg = bus.new_method_call(service.c_str(), path.c_str(),
-                                      propertiesintf, "GetAll");
+    auto pimMsg = _bus.new_method_call(service.c_str(), path.c_str(),
+                                       propertiesintf, "GetAll");
 
     pimMsg.append(sensorintf);
 
@@ -88,7 +88,7 @@
 
     try
     {
-        auto valueResponseMsg = bus.call(pimMsg);
+        auto valueResponseMsg = _bus.call(pimMsg);
         valueResponseMsg.read(propMap);
     }
     catch (const sdbusplus::exception::SdBusError& ex)
@@ -141,14 +141,14 @@
                                     const std::string& path)
 {
 
-    auto critical = bus.new_method_call(service.c_str(), path.c_str(),
-                                        propertiesintf, "GetAll");
+    auto critical = _bus.new_method_call(service.c_str(), path.c_str(),
+                                         propertiesintf, "GetAll");
     critical.append(criticalThreshInf);
     PropertyMap criticalMap;
 
     try
     {
-        auto msg = bus.call(critical);
+        auto msg = _bus.call(critical);
         msg.read(criticalMap);
     }
     catch (sdbusplus::exception_t&)