forked from ibm-openbmc/license-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainapp.cpp
30 lines (22 loc) · 853 Bytes
/
mainapp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "license_manager.hpp"
#include <sdeventplus/event.hpp>
//#include <phosphor-logging/elog-errors.hpp>
//#include <phosphor-logging/elog.hpp>
//#include <phosphor-logging/log.hpp>
//#include <xyz/openbmc_project/Common/error.hpp>
int main()
{
auto bus = sdbusplus::bus::new_default();
std::string busName = "com.ibm.License.Manager";
bus.request_name(busName.c_str());
static constexpr auto objPath = "/com/ibm/license";
// Get default event loop
auto event = sdeventplus::Event::get_default();
// Attach the bus to sd_event to service user requests
bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
// Add sdbusplus ObjectManager
sdbusplus::server::manager::manager objManager(bus, objPath);
license::manager::LicenseMgr manager(bus, event, objPath);
event.loop();
return 0;
}