summaryrefslogtreecommitdiffstats
path: root/fan_pwm.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'fan_pwm.hpp')
-rw-r--r--fan_pwm.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/fan_pwm.hpp b/fan_pwm.hpp
index 20baf38..61c0bf6 100644
--- a/fan_pwm.hpp
+++ b/fan_pwm.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include <memory>
+
#include "hwmonio.hpp"
#include "interface.hpp"
#include "sysfs.hpp"
@@ -20,15 +22,14 @@ class FanPwm : public FanPwmObject
/**
* @brief Constructs FanPwm Object
*
- * @param[in] instancePath - The hwmon instance path
- * (ex. /sys/class/hwmon/hwmon1)
+ * @param[in] io - HwmonIO
* @param[in] devPath - The /sys/devices sysfs path
* @param[in] id - The hwmon id
* @param[in] bus - Dbus bus object
* @param[in] objPath - Dbus object path
* @param[in] defer - Dbus object registration defer
*/
- FanPwm(const std::string& instancePath,
+ FanPwm(std::unique_ptr<hwmonio::HwmonIOInterface> io,
const std::string& devPath,
const std::string& id,
sdbusplus::bus::bus& bus,
@@ -36,7 +37,7 @@ class FanPwm : public FanPwmObject
bool defer,
uint64_t target) : FanPwmObject(bus, objPath, defer),
id(id),
- ioAccess(instancePath),
+ ioAccess(std::move(io)),
devPath(devPath)
{
FanPwmObject::target(target);
@@ -55,7 +56,7 @@ class FanPwm : public FanPwmObject
/** @brief hwmon id */
std::string id;
/** @brief Hwmon sysfs access. */
- hwmonio::HwmonIO ioAccess;
+ std::unique_ptr<hwmonio::HwmonIOInterface> ioAccess;
/** @brief Physical device path. */
std::string devPath;
};
OpenPOWER on IntegriCloud