Lines Matching +full:off +full:- +full:state

6 #include <phosphor-logging/lg2.hpp>
7 #include <xyz/openbmc_project/State/BMC/server.hpp>
8 #include <xyz/openbmc_project/State/Chassis/server.hpp>
18 constexpr auto bmcState = "xyz.openbmc_project.State.BMC";
19 constexpr auto chassisState = "xyz.openbmc_project.State.Chassis0";
20 constexpr auto hostState = "xyz.openbmc_project.State.Host";
25 constexpr auto bmcState = "/xyz/openbmc_project/state/bmc0";
26 constexpr auto chassisState = "/xyz/openbmc_project/state/chassis0";
27 constexpr auto hostState = "/xyz/openbmc_project/state/host0";
33 constexpr auto bmcState = "xyz.openbmc_project.State.BMC";
34 constexpr auto chassisState = "xyz.openbmc_project.State.Chassis";
35 constexpr auto hostState = "xyz.openbmc_project.State.Host";
38 using namespace sdbusplus::xyz::openbmc_project::State::server;
46 // If power not on - power on in pressed()
51 lg2::error("BMC not at ready state yet, cannot power on"); in pressed()
55 state = PowerOpState::powerOnPress; in pressed()
69 if (state == PowerOpState::buttonNotPressed) in pressed()
71 lg2::info("Starting countdown to power off"); in pressed()
72 state = PowerOpState::buttonPressed; in pressed()
77 // Button press during host off to chassis off window. in pressed()
78 // Causes a chassis power off. in pressed()
79 else if (state == PowerOpState::buttonReleasedHostToChassisOffWindow) in pressed()
81 lg2::info("Starting chassis power off due to button press"); in pressed()
82 state = PowerOpState::chassisOffStarted; in pressed()
92 // Button released in the host to chassis off window. in released()
95 if (state == PowerOpState::buttonPressedHostOffStarted) in released()
97 state = PowerOpState::buttonReleasedHostToChassisOffWindow; in released()
101 state = PowerOpState::buttonNotPressed; in released()
109 if ((state == PowerOpState::buttonPressed) && (now >= hostOffTime)) in timerHandler()
111 // Start the host power off and start the chassis in timerHandler()
112 // power off countdown. in timerHandler()
113 state = PowerOpState::buttonPressedHostOffStarted; in timerHandler()
117 else if ((state == PowerOpState::buttonPressedHostOffStarted) && in timerHandler()
120 // Button still pressed and it passed the chassis off time. in timerHandler()
121 // Issue the chassis power off. in timerHandler()
122 state = PowerOpState::chassisOffStarted; in timerHandler()
132 std::variant<std::string> state = convertForMessage(transition); in hostTransition() local
135 "TRANS", std::get<std::string>(state)); in hostTransition()
140 method.append(interface::hostState, "RequestedHostTransition", state); in hostTransition()
158 hostTransition(Host::Transition::Off); in hostPowerOff()
163 lg2::info("Power button action requesting chassis power off"); in chassisPowerOff()
167 std::variant<std::string> state = in chassisPowerOff() local
168 convertForMessage(Chassis::Transition::Off); in chassisPowerOff()
174 state); in chassisPowerOff()
180 lg2::error("Failed requesting chassis off: {ERROR}", "ERROR", e); in chassisPowerOff()
196 std::variant<std::string> state; in isPoweredOn() local
197 result.read(state); in isPoweredOn()
200 Chassis::convertPowerStateFromString(std::get<std::string>(state)); in isPoweredOn()
223 std::variant<std::string> state; in isBmcReady() local
224 result.read(state); in isBmcReady()
226 bmcState = BMC::convertBMCStateFromString(std::get<std::string>(state)); in isBmcReady()
230 lg2::error("Failed reading BMC state interface: {}", "ERROR", e); in isBmcReady()