#include "config.h" #include "bios_handler.hpp" #include "event_logger.hpp" #include "exceptions.hpp" #include "logger.hpp" #include "manager.hpp" #include "types.hpp" #include #include #include /** * @brief Main function for VPD parser application. */ int main(int, char**) { try { auto io_con = std::make_shared(); auto connection = std::make_shared(*io_con); auto server = sdbusplus::asio::object_server(connection); std::shared_ptr interface = server.add_interface(OBJPATH, IFACE); auto vpdManager = std::make_shared(io_con, interface, connection); // TODO: Take this under conditional compilation for IBM auto biosHandler = std::make_shared>( connection, vpdManager); interface->initialize(); vpd::logging::logMessage("Start VPD-Manager event loop"); // Grab the bus name connection->request_name(BUSNAME); // Start event loop. io_con->run(); exit(EXIT_SUCCESS); } catch (const std::exception& l_ex) { vpd::logging::logMessage("VPD-Manager service failed to start."); vpd::EventLogger::createAsyncPel( vpd::EventLogger::getErrorType(l_ex), vpd::types::SeverityType::Critical, __FILE__, __FUNCTION__, 0, vpd::EventLogger::getErrorMsg(l_ex), std::nullopt, std::nullopt, std::nullopt, std::nullopt); } exit(EXIT_FAILURE); }