Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include "xyz/openbmc_project/State/BMC/server.hpp" |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace state |
| 9 | { |
| 10 | namespace manager |
| 11 | { |
| 12 | |
| 13 | /** @class BMC |
| 14 | * @brief OpenBMC BMC state management implementation. |
| 15 | * @details A concrete implementation for xyz.openbmc_project.State.BMC |
| 16 | * DBus API. |
| 17 | */ |
| 18 | class BMC : public sdbusplus::server::object::object< |
| 19 | sdbusplus::xyz::openbmc_project::State::server::BMC> |
| 20 | { |
| 21 | public: |
| 22 | /** @brief Constructs BMC 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 | BMC(sdbusplus::bus::bus& bus, |
| 29 | const char* objPath) : |
| 30 | sdbusplus::server::object::object< |
| 31 | sdbusplus::xyz::openbmc_project::State::server::BMC>( |
Josh D. King | 6db3822 | 2016-12-19 14:52:40 -0600 | [diff] [blame^] | 32 | bus, objPath), |
| 33 | bus(bus) |
| 34 | { |
| 35 | subscribeToSystemdSignals(); |
| 36 | }; |
| 37 | |
| 38 | /** @brief Set value of BMCTransition **/ |
| 39 | Transition requestedBMCTransition(Transition value) override; |
| 40 | |
| 41 | /** @breif Set value of CurrentBMCState **/ |
| 42 | BMCState currentBMCState(BMCState value) override; |
| 43 | |
| 44 | private: |
| 45 | /** |
| 46 | * @brief subscribe to the systemd signals |
| 47 | **/ |
| 48 | void subscribeToSystemdSignals(); |
| 49 | |
| 50 | /** @brief Persistent sdbusplus DBus bus connection. **/ |
| 51 | sdbusplus::bus::bus& bus; |
| 52 | |
Josh D. King | bdd9cb7 | 2016-12-19 11:13:43 -0600 | [diff] [blame] | 53 | |
| 54 | }; |
| 55 | |
| 56 | } // namespace manager |
| 57 | } // namespace state |
| 58 | } // namespace phosphor |