blob: efcb4d02d46d8848b5c1d9b33decec99e66cd206 [file] [log] [blame]
Alexander Hansen44c90252025-06-27 15:17:42 +02001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
17#include "entity_manager.hpp"
18
19#include <boost/asio/io_context.hpp>
20#include <boost/asio/post.hpp>
21#include <nlohmann/json.hpp>
22#include <sdbusplus/asio/connection.hpp>
23
24int main()
25{
26 boost::asio::io_context io;
27 auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
28 systemBus->request_name("xyz.openbmc_project.EntityManager");
29 EntityManager em(systemBus, io);
30
31 nlohmann::json systemConfiguration = nlohmann::json::object();
32
33 boost::asio::post(io, [&]() { em.propertiesChangedCallback(); });
34
35 em.handleCurrentConfigurationJson();
36
37 // some boards only show up after power is on, we want to not say they are
38 // removed until the same state happens
39 em.powerStatus.setupPowerMatch(em.systemBus);
40
41 io.run();
42
43 return 0;
44}