sensor: to enable testing receive hwmonio interface pointer
The sensor objects all share a reference to the mainloop's ioAccess
object. To enable testing, the sensor object needs to expect the base
pointer to this object.
Change-Id: I1d7f2841528776c8d4f1166e20874ddeb4b8554a
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/sensor.hpp b/sensor.hpp
index 37cf035..3bcfc82 100644
--- a/sensor.hpp
+++ b/sensor.hpp
@@ -6,6 +6,7 @@
#include <chrono>
#include <gpioplus/handle.hpp>
+#include <memory>
#include <unordered_set>
namespace sensor
@@ -42,7 +43,7 @@
* @param[in] devPath - Device sysfs path
*/
explicit Sensor(const SensorSet::key_type& sensor,
- const hwmonio::HwmonIO& ioAccess,
+ const hwmonio::HwmonIOInterface* ioAccess,
const std::string& devPath);
/**
@@ -128,7 +129,7 @@
SensorSet::key_type sensor;
/** @brief Hwmon sysfs access. */
- const hwmonio::HwmonIO& ioAccess;
+ const hwmonio::HwmonIOInterface* ioAccess;
/** @brief Physical device sysfs path. */
const std::string& devPath;