diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2019-01-18 09:30:57 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2019-02-13 14:31:44 -0600 |
commit | 93af41944aa471840e1ea5a7e2ad465635faa7f0 (patch) | |
tree | c610cdab28210b06ed71183ede9ca9672e4edc91 /control/zone.hpp | |
parent | 14cc043f48a23f6e7e9cf46b6475b0b32880c984 (diff) | |
download | phosphor-fan-presence-93af41944aa471840e1ea5a7e2ad465635faa7f0.tar.gz phosphor-fan-presence-93af41944aa471840e1ea5a7e2ad465635faa7f0.zip |
Add thermal control interface to zone objects
When in control mode, the thermal control interface and mode property
are added to each zone object. The object path for each zone consists of
the configured object path plus the zone number.
Ex) /xyz/openbmc_project/control/thermal/0
Tested:
After fan control is started in control mode, dbus interface exists
Change-Id: I88578a7e0eb7c730ffaa4cfc10989e280dc1d46d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.hpp')
-rw-r--r-- | control/zone.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/control/zone.hpp b/control/zone.hpp index 9c85655..ad4d4b4 100644 --- a/control/zone.hpp +++ b/control/zone.hpp @@ -7,6 +7,7 @@ #include <vector> #include "fan.hpp" #include "types.hpp" +#include "xyz/openbmc_project/Control/ThermalMode/server.hpp" namespace phosphor { @@ -15,6 +16,9 @@ namespace fan namespace control { +using ThermalObject = sdbusplus::server::object::object< + sdbusplus::xyz::openbmc_project::Control::server::ThermalMode>; + /** * The mode fan control will run in: * - init - only do the initialization steps @@ -30,7 +34,7 @@ enum class Mode * @class Represents a fan control zone, which is a group of fans * that behave the same. */ -class Zone +class Zone : public ThermalObject { public: @@ -48,11 +52,13 @@ class Zone * * @param[in] mode - mode of fan control * @param[in] bus - the dbus object + * @param[in] path - object instance path * @param[in] event - Event loop reference * @param[in] def - the fan zone definition data */ Zone(Mode mode, sdbusplus::bus::bus& bus, + const std::string& path, const sdeventplus::Event& event, const ZoneDefinition& def); @@ -470,6 +476,11 @@ class Zone sdbusplus::bus::bus& _bus; /** + * Zone object path + */ + const std::string _path; + + /** * Full speed for the zone */ const uint64_t _fullSpeed; |