summaryrefslogtreecommitdiffstats
path: root/control/zone.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2019-01-18 09:30:57 -0600
committerMatthew Barth <msbarth@us.ibm.com>2019-02-13 14:31:44 -0600
commit93af41944aa471840e1ea5a7e2ad465635faa7f0 (patch)
treec610cdab28210b06ed71183ede9ca9672e4edc91 /control/zone.cpp
parent14cc043f48a23f6e7e9cf46b6475b0b32880c984 (diff)
downloadphosphor-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.cpp')
-rw-r--r--control/zone.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index 293945c..9333daa 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -39,9 +39,12 @@ using InternalFailure = sdbusplus::xyz::openbmc_project::Common::
Zone::Zone(Mode mode,
sdbusplus::bus::bus& bus,
+ const std::string& path,
const sdeventplus::Event& event,
const ZoneDefinition& def) :
+ ThermalObject(bus, path.c_str(), true),
_bus(bus),
+ _path(path),
_fullSpeed(std::get<fullSpeedPos>(def)),
_zoneNum(std::get<zoneNumPos>(def)),
_defFloorSpeed(std::get<floorSpeedPos>(def)),
@@ -60,8 +63,13 @@ Zone::Zone(Mode mode,
}
// Do not enable set speed events when in init mode
- if (mode != Mode::init)
+ if (mode == Mode::control)
{
+ // TODO Determine thermal control mode states
+
+ // Emit objects added in control mode only
+ this->emit_object_added();
+
// Update target speed to current zone target speed
if (!_fans.empty())
{
OpenPOWER on IntegriCloud