| Alexander Hansen | 4e1142d | 2025-07-25 17:07:27 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation |
| Alexander Hansen | 44c9025 | 2025-06-27 15:17:42 +0200 | [diff] [blame] | 3 | |
| 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 | |
| 11 | int main() |
| 12 | { |
| Alexander Hansen | 8290ca4 | 2025-08-04 15:27:22 +0200 | [diff] [blame^] | 13 | const std::vector<std::filesystem::path> configurationDirectories = { |
| 14 | PACKAGE_DIR "configurations", SYSCONF_DIR "configurations"}; |
| 15 | |
| Alexander Hansen | 44c9025 | 2025-06-27 15:17:42 +0200 | [diff] [blame] | 16 | boost::asio::io_context io; |
| 17 | auto systemBus = std::make_shared<sdbusplus::asio::connection>(io); |
| 18 | systemBus->request_name("xyz.openbmc_project.EntityManager"); |
| Alexander Hansen | 8290ca4 | 2025-08-04 15:27:22 +0200 | [diff] [blame^] | 19 | EntityManager em(systemBus, io, configurationDirectories); |
| Alexander Hansen | 44c9025 | 2025-06-27 15:17:42 +0200 | [diff] [blame] | 20 | |
| Alexander Hansen | 44c9025 | 2025-06-27 15:17:42 +0200 | [diff] [blame] | 21 | boost::asio::post(io, [&]() { em.propertiesChangedCallback(); }); |
| 22 | |
| 23 | em.handleCurrentConfigurationJson(); |
| 24 | |
| Alexander Hansen | 44c9025 | 2025-06-27 15:17:42 +0200 | [diff] [blame] | 25 | io.run(); |
| 26 | |
| 27 | return 0; |
| 28 | } |