diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-05-09 11:03:14 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2017-05-16 17:27:46 -0500 |
commit | ee7f64283f2fe728fd4bd67280bf59daaec9df54 (patch) | |
tree | 94df674fdcd96606d10ed55976dffda9d87fa78b /control/manager.hpp | |
parent | 389ca67fcd47dbc5375fe9993f3b35ba1af32cff (diff) | |
download | phosphor-fan-presence-ee7f64283f2fe728fd4bd67280bf59daaec9df54.tar.gz phosphor-fan-presence-ee7f64283f2fe728fd4bd67280bf59daaec9df54.zip |
Add modes to phosphor-fan-control
phosphor-fan-control can behave differently based
on its command line arguments
--init: Set fans to full speed, delay for a
configurable amount of time to allow fans to ramp up,
start the fan control ready target, and then exit.
--control: Start the control algorithm. Never exits.
Will be started as part of the fan control ready target.
Change-Id: I453daf8cc05a5c85a19c098e1cca64cac2ad9520
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'control/manager.hpp')
-rw-r--r-- | control/manager.hpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/control/manager.hpp b/control/manager.hpp index 7f8baa3..675dfb8 100644 --- a/control/manager.hpp +++ b/control/manager.hpp @@ -23,6 +23,17 @@ class Manager { public: + /** + * The mode the manager will run in: + * - init - only do the initialization steps + * - control - run normal control algorithms + */ + enum class Mode + { + init, + control + }; + Manager() = delete; Manager(const Manager&) = delete; Manager(Manager&&) = default; @@ -36,12 +47,26 @@ class Manager * _zoneLayouts data. * * @param[in] bus - The dbus object + * @param[in] mode - The control mode + */ + Manager(sdbusplus::bus::bus& bus, + Mode mode); + + /** + * Does the fan control inititialization, which is + * setting fans to full, delaying so they + * can get there, and starting a target. */ - Manager(sdbusplus::bus::bus& bus); + void doInit(); private: /** + * Starts the obmc-fan-control-ready dbus target + */ + void startFanControlReadyTarget(); + + /** * The dbus object */ sdbusplus::bus::bus& _bus; @@ -56,6 +81,13 @@ class Manager * This is generated data. */ static const std::vector<ZoneGroup> _zoneLayouts; + + /** + * The number of seconds to delay after + * fans get set to high speed on a power on + * to give them a chance to get there. + */ + static const unsigned int _powerOnDelay; }; |