blob: f3df078e4b691ac4e8a0d3aa4f58ef14976a9a50 [file] [log] [blame]
Andrew Geisslera90a31a2016-12-13 16:16:28 -06001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include "xyz/openbmc_project/State/Chassis/server.hpp"
5
6namespace phosphor
7{
8namespace state
9{
10namespace manager
11{
12
13/** @class Chassis
14 * @brief OpenBMC chassis state management implementation.
15 * @details A concrete implementation for xyz.openbmc_project.State.Chassis
16 * DBus API.
17 */
18class Chassis : public sdbusplus::server::object::object<
19 sdbusplus::xyz::openbmc_project::State::server::Chassis>
20{
21 public:
22 /** @brief Constructs Chassis State Manager
23 *
24 * @param[in] bus - The Dbus bus object
25 * @param[in] busName - The Dbus name to own
26 * @param[in] objPath - The Dbus object path
27 */
28 Chassis(sdbusplus::bus::bus& bus,
29 const char* busName,
30 const char* objPath) :
31 sdbusplus::server::object::object<
32 sdbusplus::xyz::openbmc_project::State::server::Chassis>(
33 bus, objPath),
34 bus(bus)
35 {}
36
37 /** @brief Set value of RequestedPowerTransition */
38 Transition requestedPowerTransition(Transition value) override;
39
40 /** @brief Set value of CurrentPowerState */
41 PowerState currentPowerState(PowerState value) override;
42
43 private:
44 /** @brief Persistent sdbusplus DBus connection. */
45 sdbusplus::bus::bus& bus;
46};
47
48} // namespace manager
49} // namespace state
50} // namespace phosphor