diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-09-27 16:24:45 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2017-10-02 13:06:48 -0500 |
commit | 6fa181c781e59961e61f9cf5755ed220c2428c16 (patch) | |
tree | 9aa5e46d141601d91e3737e57eea654483d1a6b2 /monitor/tach_sensor.hpp | |
parent | 4c04a016faa989bbc1ad4334b164535f017954b1 (diff) | |
download | phosphor-fan-presence-6fa181c781e59961e61f9cf5755ed220c2428c16.tar.gz phosphor-fan-presence-6fa181c781e59961e61f9cf5755ed220c2428c16.zip |
monitor: Move timer ops into TachSensor
Upcoming commits will touch the TachSensor timer
outside of the Fan class, and it will be cleaner to
encapsulate the operations in TachSensor.
Change-Id: I8584c44eb5dbe6bb93191a006d20dfc37596eeb3
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'monitor/tach_sensor.hpp')
-rw-r--r-- | monitor/tach_sensor.hpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp index 4691d1e..60a55e3 100644 --- a/monitor/tach_sensor.hpp +++ b/monitor/tach_sensor.hpp @@ -101,11 +101,32 @@ class TachSensor } /** - * Returns the timer object for this sensor + * @brief Says if the timer is running or not + * + * @return bool - if timer is currently running + */ + inline bool timerRunning() + { + return _timer.running(); + } + + /** + * @brief Starts the timer for the amount of time + * specified in the constructor + */ + inline void startTimer() + { + _timer.start( + getTimeout(), + phosphor::fan::util::Timer::TimerType::oneshot); + } + + /** + * @brief Stops the timer */ - inline phosphor::fan::util::Timer& getTimer() + inline void stopTimer() { - return _timer; + _timer.stop(); } /** |