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 | { |
Jagpal Singh Gill | bb024eb | 2024-04-07 23:34:00 -0700 | [diff] [blame^] | 18 | sdbusplus::async::context ctx; |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 19 | |
20 | // Add sdbusplus ObjectManager. | ||||
Jagpal Singh Gill | bb024eb | 2024-04-07 23:34:00 -0700 | [diff] [blame^] | 21 | sdbusplus::server::manager_t objManager(ctx, SOFTWARE_OBJPATH); |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 22 | |
Jagpal Singh Gill | bb024eb | 2024-04-07 23:34:00 -0700 | [diff] [blame^] | 23 | phosphor::software::updater::ItemUpdater updater(ctx, SOFTWARE_OBJPATH, |
24 | false); | ||||
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 25 | |
Jagpal Singh Gill | bb024eb | 2024-04-07 23:34:00 -0700 | [diff] [blame^] | 26 | ctx.request_name(BUSNAME_UPDATER); |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 27 | |
Jagpal Singh Gill | bb024eb | 2024-04-07 23:34:00 -0700 | [diff] [blame^] | 28 | ctx.run(); |
Lei YU | 2586818 | 2021-05-14 14:50:51 +0800 | [diff] [blame] | 29 | |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 30 | return 0; |
31 | } |