hwmonio:: Add Interface base class and tests
Enable injecting hwmonio::HwmonIO mocks for testing.
Tested: Ran on quanta-q71l and saw all sensors exported to dbus as
expected with the expected values.
Change-Id: I35912bf2a733932d9e1e774ff53b0114ae16560b
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/fan_speed.cpp b/fan_speed.cpp
index f1afd55..9e297bc 100644
--- a/fan_speed.cpp
+++ b/fan_speed.cpp
@@ -21,7 +21,7 @@
//Write target out to sysfs
try
{
- ioAccess.write(
+ ioAccess->write(
value,
type,
id,
@@ -41,7 +41,7 @@
WriteFailure::CALLOUT_DEVICE_PATH(devPath.c_str()));
auto file = sysfs::make_sysfs_path(
- ioAccess.path(),
+ ioAccess->path(),
type,
id,
entry::target);
@@ -66,7 +66,7 @@
try
{
- ioAccess.write(
+ ioAccess->write(
val,
type::pwm,
id,
@@ -85,7 +85,7 @@
WriteFailure::CALLOUT_DEVICE_PATH(devPath.c_str()));
auto fullPath = sysfs::make_sysfs_path(
- ioAccess.path(),
+ ioAccess->path(),
type::pwm,
id,
entry::enable);