blob: 29840e2d613fd7c487ec62f76c8950f26cd87cae [file] [log] [blame]
Alexander Hansen0ab32b32025-06-27 14:50:33 +02001#pragma once
2
3#include <sdbusplus/asio/connection.hpp>
4#include <sdbusplus/bus/match.hpp>
5
6namespace power
7{
8
9const static constexpr char* busname = "xyz.openbmc_project.State.Host";
10const static constexpr char* interface = "xyz.openbmc_project.State.Host";
11const static constexpr char* path = "/xyz/openbmc_project/state/host0";
12const static constexpr char* property = "CurrentHostState";
13
14class PowerStatusMonitor
15{
16 public:
17 bool isPowerOn();
18 void setupPowerMatch(
19 const std::shared_ptr<sdbusplus::asio::connection>& conn);
20
21 private:
22 bool powerStatusOn = false;
23 std::unique_ptr<sdbusplus::bus::match_t> powerMatch = nullptr;
24};
25
26} // namespace power