blob: b063ac40f2ccd952aa84249398ab3762e343a266 [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
8namespace pid_control
9{
10namespace ipmi
11{
12
Patrick Venture09334bb2020-08-16 12:22:54 -070013class 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};
Patrick Ventured82d0b72020-08-16 09:17:37 -070038
39} // namespace ipmi
40} // namespace pid_control