Create PMBusBase class to allow for mocking

Derive the PMBus class from a new PMBusBase class to allow for the use
of Google Mock for unit testing. Create an interface to PMBusBase in the
phosphor-power-supply code.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I6dd8d8a64bdece0d82478450ec83f1aefcae4c75
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 419e1a7..c3ff051 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "pmbus.hpp"
 #include "types.hpp"
 
 #include <sdbusplus/bus/match.hpp>
@@ -28,7 +29,8 @@
     PowerSupply(sdbusplus::bus::bus& bus, const std::string& invpath,
                 std::uint8_t i2cbus, const std::string& i2caddr) :
         bus(bus),
-        inventoryPath(invpath), i2cbus(i2cbus), i2caddr(i2caddr)
+        inventoryPath(invpath),
+        pmbusIntf(phosphor::pmbus::createPMBus(i2cbus, i2caddr))
     {
         // Setup the functions to call when the D-Bus inventory path for the
         // Present property changes.
@@ -108,19 +110,6 @@
      **/
     std::string inventoryPath;
 
-    /**
-     * @brief I2C bus that this power supply is on.
-     */
-    std::uint8_t i2cbus;
-
-    /**
-     * @brief I2C address of this power supply.
-     *
-     * The PMBus device driver will put this in a path with 16-bit address,
-     * represented as a file path string.
-     */
-    std::string i2caddr;
-
     /** @brief True if the power supply is present. */
     bool present = false;
 
@@ -135,6 +124,13 @@
     std::unique_ptr<sdbusplus::bus::match_t> presentAddedMatch;
 
     /**
+     * @brief Pointer to the PMBus interface
+     *
+     * Used to read or write to/from PMBus power supply devices.
+     */
+    std::unique_ptr<phosphor::pmbus::PMBusBase> pmbusIntf;
+
+    /**
      *  @brief Updates the presence status by querying D-Bus
      *
      * The D-Bus inventory properties for this power supply will be read to