Deepak Kodihalli | 6b492fb | 2017-03-18 01:09:28 -0500 | [diff] [blame] | 1 | #include <phosphor-logging/log.hpp> |
| 2 | #include <exception> |
Vishwanatha Subbanna | 2180b2d | 2017-06-28 14:05:57 +0530 | [diff] [blame] | 3 | #include "occ_manager.hpp" |
| 4 | #include "config.h" |
Deepak Kodihalli | 92a6341 | 2017-03-17 05:01:00 -0500 | [diff] [blame] | 5 | |
| 6 | int main(int argc, char* argv[]) |
| 7 | { |
Deepak Kodihalli | 6b492fb | 2017-03-18 01:09:28 -0500 | [diff] [blame] | 8 | try |
Deepak Kodihalli | 92a6341 | 2017-03-17 05:01:00 -0500 | [diff] [blame] | 9 | { |
Deepak Kodihalli | fd358d1 | 2017-05-08 07:11:22 -0500 | [diff] [blame] | 10 | auto bus = sdbusplus::bus::new_default(); |
Vishwanatha Subbanna | 2180b2d | 2017-06-28 14:05:57 +0530 | [diff] [blame] | 11 | bus.request_name(OCC_CONTROL_BUSNAME); |
Deepak Kodihalli | fd358d1 | 2017-05-08 07:11:22 -0500 | [diff] [blame] | 12 | |
| 13 | sdbusplus::server::manager::manager objManager(bus, |
Vishwanatha Subbanna | 2180b2d | 2017-06-28 14:05:57 +0530 | [diff] [blame] | 14 | OCC_CONTROL_ROOT); |
Deepak Kodihalli | fd358d1 | 2017-05-08 07:11:22 -0500 | [diff] [blame] | 15 | |
Vishwanatha Subbanna | 2180b2d | 2017-06-28 14:05:57 +0530 | [diff] [blame] | 16 | open_power::occ::Manager mgr(bus); |
Deepak Kodihalli | fd358d1 | 2017-05-08 07:11:22 -0500 | [diff] [blame] | 17 | |
| 18 | while (true) |
| 19 | { |
| 20 | bus.process_discard(); |
| 21 | bus.wait(); |
| 22 | } |
Deepak Kodihalli | 6b492fb | 2017-03-18 01:09:28 -0500 | [diff] [blame] | 23 | } |
| 24 | catch (const std::exception& e) |
| 25 | { |
| 26 | using namespace phosphor::logging; |
| 27 | log<level::ERR>(e.what()); |
| 28 | return -1; |
Deepak Kodihalli | 92a6341 | 2017-03-17 05:01:00 -0500 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | return 0; |
| 32 | } |