blob: bf8c0d97f83e4e37b1790c1d2e68d2165d45b5c6 [file] [log] [blame]
SunnySrivastava1984b59fd092020-02-03 09:58:56 -06001#include "config.h"
2
3#include "manager.hpp"
4
Sunny Srivastava523af2e2022-02-14 07:30:10 -06005#include <sdbusplus/asio/connection.hpp>
SunnySrivastava1984b59fd092020-02-03 09:58:56 -06006
Priyanga Ramasamy9d149342020-07-16 23:41:26 +05307int main(int /*argc*/, char** /*argv*/)
SunnySrivastava1984b59fd092020-02-03 09:58:56 -06008{
9 try
10 {
Sunny Srivastava523af2e2022-02-14 07:30:10 -060011 auto io_con = std::make_shared<boost::asio::io_context>();
12 auto connection =
13 std::make_shared<sdbusplus::asio::connection>(*io_con);
14 connection->request_name(BUSNAME);
15
16 auto server = sdbusplus::asio::object_server(connection);
17
18 std::shared_ptr<sdbusplus::asio::dbus_interface> interface =
19 server.add_interface(OBJPATH, IFACE);
20
21 auto vpdManager = std::make_shared<openpower::vpd::manager::Manager>(
22 io_con, interface, connection);
23 interface->initialize();
24
25 // Start event loop.
26 io_con->run();
27
SunnySrivastava1984b59fd092020-02-03 09:58:56 -060028 exit(EXIT_SUCCESS);
29 }
30 catch (const std::exception& e)
31 {
32 std::cerr << e.what() << "\n";
33 }
34 exit(EXIT_FAILURE);
35}