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