blob: 0955607ae1107dd2f87c0608d58ba577f1553436 [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
Alexander Hansen0ab32b32025-06-27 14:50:33 +02009class PowerStatusMonitor
10{
11 public:
12 bool isPowerOn();
13 void setupPowerMatch(
14 const std::shared_ptr<sdbusplus::asio::connection>& conn);
15
16 private:
Alexander Hansen0a4bb2a2025-07-25 11:34:48 +020017 void handlePowerMatch(sdbusplus::message_t& message);
18
Alexander Hansen0ab32b32025-06-27 14:50:33 +020019 bool powerStatusOn = false;
20 std::unique_ptr<sdbusplus::bus::match_t> powerMatch = nullptr;
21};
22
23} // namespace power