Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
| 3 | #include "item_updater.hpp" |
| 4 | |
Lei YU | 2586818 | 2021-05-14 14:50:51 +0800 | [diff] [blame] | 5 | #include <boost/asio/io_context.hpp> |
| 6 | #include <sdbusplus/asio/connection.hpp> |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 7 | #include <sdbusplus/bus.hpp> |
| 8 | #include <sdbusplus/server/manager.hpp> |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 9 | |
Lei YU | 2586818 | 2021-05-14 14:50:51 +0800 | [diff] [blame] | 10 | boost::asio::io_context& getIOContext() |
| 11 | { |
| 12 | static boost::asio::io_context io; |
| 13 | return io; |
| 14 | } |
| 15 | |
Adriana Kobylak | 292159f | 2020-05-05 09:25:55 -0500 | [diff] [blame] | 16 | int main() |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 17 | { |
Lei YU | 2586818 | 2021-05-14 14:50:51 +0800 | [diff] [blame] | 18 | sdbusplus::asio::connection bus(getIOContext()); |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 19 | |
| 20 | // Add sdbusplus ObjectManager. |
| 21 | sdbusplus::server::manager::manager objManager(bus, SOFTWARE_OBJPATH); |
| 22 | |
Michael Tritz | 37a5904 | 2017-07-12 13:44:53 -0500 | [diff] [blame] | 23 | phosphor::software::updater::ItemUpdater updater(bus, SOFTWARE_OBJPATH); |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 24 | |
| 25 | bus.request_name(BUSNAME_UPDATER); |
| 26 | |
Lei YU | 2586818 | 2021-05-14 14:50:51 +0800 | [diff] [blame] | 27 | getIOContext().run(); |
| 28 | |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 29 | return 0; |
| 30 | } |