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>
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 @@
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 @@
}
// 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())
{