1 #pragma once
2 
3 #include "control.hpp"
4 
5 #include <cstdint>
6 #include <string>
7 
8 namespace pid_control
9 {
10 namespace ipmi
11 {
12 
13 class DbusZoneControl : public ZoneControlInterface
14 {
15   public:
16     DbusZoneControl() = default;
17     ~DbusZoneControl() = default;
18 
19     /*
20      * busctl call xyz.openbmc_project.State.FanCtrl \
21      *     /xyz/openbmc_project/settings/fanctrl/zone1 \
22      *     org.freedesktop.DBus.Properties \
23      *     GetAll \
24      *     s \
25      *     xyz.openbmc_project.Control.Mode
26      * a{sv} 2 "Manual" b false "FailSafe" b false
27      *
28      * This returns an IPMI code as a uint8_t (which will always be sufficient
29      * to hold the result). NOTE: This does not return the typedef value to
30      * avoid including a header with conflicting types.
31      */
32     uint8_t getFanCtrlProperty(uint8_t zoneId, bool* value,
33                                const std::string& property) override;
34 
35     uint8_t setFanCtrlProperty(uint8_t zoneId, bool value,
36                                const std::string& property) override;
37 };
38 
39 } // namespace ipmi
40 } // namespace pid_control
41