blob: 7a23e52a10a363228686ee8b791ce81249ce9b72 [file] [log] [blame]
Patrick Ventured82d0b72020-08-16 09:17:37 -07001#pragma once
2
Patrick Venture09334bb2020-08-16 12:22:54 -07003#include "control.hpp"
4
Patrick Ventured82d0b72020-08-16 09:17:37 -07005#include <cstdint>
6#include <string>
7
George Liu92110f82025-07-02 15:07:35 +08008namespace pid_control::ipmi
Patrick Ventured82d0b72020-08-16 09:17:37 -07009{
10
Patrick Venture09334bb2020-08-16 12:22:54 -070011class DbusZoneControl : public ZoneControlInterface
12{
13 public:
14 DbusZoneControl() = default;
Ed Tanousd2768c52025-06-26 11:42:57 -070015 ~DbusZoneControl() override = default;
Patrick Venture09334bb2020-08-16 12:22:54 -070016
17 /*
18 * busctl call xyz.openbmc_project.State.FanCtrl \
19 * /xyz/openbmc_project/settings/fanctrl/zone1 \
20 * org.freedesktop.DBus.Properties \
21 * GetAll \
22 * s \
23 * xyz.openbmc_project.Control.Mode
24 * a{sv} 2 "Manual" b false "FailSafe" b false
25 *
26 * This returns an IPMI code as a uint8_t (which will always be sufficient
27 * to hold the result). NOTE: This does not return the typedef value to
28 * avoid including a header with conflicting types.
29 */
30 uint8_t getFanCtrlProperty(uint8_t zoneId, bool* value,
31 const std::string& property) override;
32
33 uint8_t setFanCtrlProperty(uint8_t zoneId, bool value,
34 const std::string& property) override;
35};
Patrick Ventured82d0b72020-08-16 09:17:37 -070036
George Liu92110f82025-07-02 15:07:35 +080037} // namespace pid_control::ipmi