George Liu | c777bef | 2020-11-23 17:04:21 +0800 | [diff] [blame^] | 1 | #include "config.h" |
| 2 | |
| 3 | #include "lamptest.hpp" |
| 4 | |
| 5 | namespace phosphor |
| 6 | { |
| 7 | namespace led |
| 8 | { |
| 9 | |
| 10 | void LampTest::stop() |
| 11 | { |
| 12 | timer.setEnabled(false); |
| 13 | } |
| 14 | |
| 15 | void LampTest::start() |
| 16 | { |
| 17 | // restart lamp test, it contains initiate or reset the timer. |
| 18 | timer.restart(std::chrono::seconds(LAMP_TEST_TIMEOUT_IN_SECS)); |
| 19 | } |
| 20 | |
| 21 | void LampTest::timeOutHandler() |
| 22 | { |
| 23 | // set the Asserted property of lamp test to false |
| 24 | } |
| 25 | |
| 26 | void LampTest::requestHandler(bool value) |
| 27 | { |
| 28 | if (value) |
| 29 | { |
| 30 | start(); |
| 31 | } |
| 32 | else |
| 33 | { |
| 34 | stop(); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | } // namespace led |
| 39 | } // namespace phosphor |