summaryrefslogtreecommitdiffstats
path: root/monitor/tach_sensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/tach_sensor.cpp')
-rw-r--r--monitor/tach_sensor.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index c991bb6..806eed7 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -84,13 +84,14 @@ TachSensor::TachSensor(sdbusplus::bus::bus& bus,
Fan& fan,
const std::string& id,
bool hasTarget,
- size_t timeout) :
-
+ size_t timeout,
+ std::shared_ptr<sd_event>& events) :
_bus(bus),
_fan(fan),
_name(FAN_SENSOR_PATH + id),
_hasTarget(hasTarget),
- _timeout(timeout)
+ _timeout(timeout),
+ _timer(events, [this, &fan](){ fan.timerExpired(*this); })
{
auto service = getService();
@@ -232,6 +233,14 @@ void TachSensor::handleTachChange(sdbusplus::message::message& msg,
}
+std::chrono::microseconds TachSensor::getTimeout()
+{
+ using namespace std::chrono;
+
+ return duration_cast<microseconds>(seconds(_timeout));
+}
+
+
}
}
}
OpenPOWER on IntegriCloud