blob: 7e41ad7ba401ab875d733576e1efdf02611e03dc [file] [log] [blame]
Gunnar Millsb0ce9962018-09-07 13:39:10 -05001#include "config.h"
2
3#include "item_updater.hpp"
4
Lei YU25868182021-05-14 14:50:51 +08005#include <boost/asio/io_context.hpp>
6#include <sdbusplus/asio/connection.hpp>
Gunnar Millsec1b41c2017-05-02 12:20:36 -05007#include <sdbusplus/bus.hpp>
8#include <sdbusplus/server/manager.hpp>
Gunnar Millsec1b41c2017-05-02 12:20:36 -05009
Lei YU25868182021-05-14 14:50:51 +080010boost::asio::io_context& getIOContext()
11{
12 static boost::asio::io_context io;
13 return io;
14}
15
Adriana Kobylak292159f2020-05-05 09:25:55 -050016int main()
Gunnar Millsec1b41c2017-05-02 12:20:36 -050017{
Lei YU25868182021-05-14 14:50:51 +080018 sdbusplus::asio::connection bus(getIOContext());
Gunnar Millsec1b41c2017-05-02 12:20:36 -050019
20 // Add sdbusplus ObjectManager.
21 sdbusplus::server::manager::manager objManager(bus, SOFTWARE_OBJPATH);
22
Michael Tritz37a59042017-07-12 13:44:53 -050023 phosphor::software::updater::ItemUpdater updater(bus, SOFTWARE_OBJPATH);
Gunnar Millsec1b41c2017-05-02 12:20:36 -050024
25 bus.request_name(BUSNAME_UPDATER);
26
Lei YU25868182021-05-14 14:50:51 +080027 getIOContext().run();
28
Gunnar Millsec1b41c2017-05-02 12:20:36 -050029 return 0;
30}