blob: 8b8ead5148bed7bc65e6e79cf5bf45bf20e05160 [file] [log] [blame]
Alexander Hansen4e1142d2025-07-25 17:07:27 +02001// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright 2018 Intel Corporation
Alexander Hansen44c90252025-06-27 15:17:42 +02003
4#include "entity_manager.hpp"
5
6#include <boost/asio/io_context.hpp>
7#include <boost/asio/post.hpp>
8#include <nlohmann/json.hpp>
9#include <sdbusplus/asio/connection.hpp>
10
11int main()
12{
Alexander Hansen8290ca42025-08-04 15:27:22 +020013 const std::vector<std::filesystem::path> configurationDirectories = {
14 PACKAGE_DIR "configurations", SYSCONF_DIR "configurations"};
15
Alexander Hansen44c90252025-06-27 15:17:42 +020016 boost::asio::io_context io;
17 auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
18 systemBus->request_name("xyz.openbmc_project.EntityManager");
Alexander Hansen8290ca42025-08-04 15:27:22 +020019 EntityManager em(systemBus, io, configurationDirectories);
Alexander Hansen44c90252025-06-27 15:17:42 +020020
Alexander Hansen44c90252025-06-27 15:17:42 +020021 boost::asio::post(io, [&]() { em.propertiesChangedCallback(); });
22
23 em.handleCurrentConfigurationJson();
24
Alexander Hansen44c90252025-06-27 15:17:42 +020025 io.run();
26
27 return 0;
28}