zone: Add debug interface to zone dbus path
- Add xyz.openbmc_project.Debug.Pid.Zone interface to fanctrl/zoneX dbus
to record the PID config name which is driving this zone.
TEST:
```
busctl introspect xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone0 xyz.openbmc_project.Debug.Pid.Zone
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.Leader property s "CPU0_PID" emits-change
```
Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
Change-Id: I6fcfa596eec6b51a7727c2a01e7d36e3698eebcf
diff --git a/pid/zone.hpp b/pid/zone.hpp
index 53d90fd..85a9064 100644
--- a/pid/zone.hpp
+++ b/pid/zone.hpp
@@ -11,6 +11,7 @@
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server.hpp>
#include <xyz/openbmc_project/Control/Mode/server.hpp>
+#include <xyz/openbmc_project/Debug/Pid/Zone/server.hpp>
#include <xyz/openbmc_project/Object/Enable/server.hpp>
#include <fstream>
@@ -24,7 +25,9 @@
template <typename... T>
using ServerObject = typename sdbusplus::server::object_t<T...>;
using ModeInterface = sdbusplus::xyz::openbmc_project::Control::server::Mode;
-using ModeObject = ServerObject<ModeInterface>;
+using DebugZoneInterface =
+ sdbusplus::xyz::openbmc_project::Debug::Pid::server::Zone;
+using ModeObject = ServerObject<ModeInterface, DebugZoneInterface>;
using ProcessInterface =
sdbusplus::xyz::openbmc_project::Object::server::Enable;
using ProcessObject = ServerObject<ProcessInterface>;
@@ -102,6 +105,8 @@
bool manual(bool value) override;
/* Method for reading whether in fail-safe mode over dbus */
bool failSafe() const override;
+ /* Method for recording the maximum SetPoint PID config name */
+ std::string leader() const override;
/* Method for control process for each loop at runtime */
void addPidControlProcess(std::string name, sdbusplus::bus_t& bus,
std::string objPath, bool defer);