1 #include <memory>
2 #include <iostream>
3 #include "occ_pass_through.hpp"
4 #include "occ_finder.hpp"
5 
6 namespace open_power
7 {
8 namespace occ
9 {
10 namespace pass_through
11 {
12 
13 void run()
14 {
15     auto bus = sdbusplus::bus::new_default();
16     sdbusplus::server::manager::manager objManager(bus,
17                                                    OCC_PASS_THROUGH_ROOT);
18 
19     std::vector<std::unique_ptr<PassThrough>> objects;
20     auto occs = open_power::occ::finder::get();
21 
22     for (const auto& occ : occs)
23     {
24         auto occPassThrough = object(occ);
25         objects.emplace_back(
26             std::make_unique<PassThrough>(bus, occPassThrough.c_str()));
27     }
28     bus.request_name(OCC_PASS_THROUGH_BUSNAME);
29 
30     while (true)
31     {
32         bus.process_discard();
33         bus.wait();
34     }
35 }
36 
37 PassThrough::PassThrough(
38     sdbusplus::bus::bus& bus,
39     const char* path) :
40     Iface(bus, path),
41     path(path)
42 {
43     this->emit_object_added();
44 }
45 
46 std::vector<int32_t> PassThrough::send(std::vector<int32_t> command)
47 {
48     return {};
49 }
50 
51 } // namespace pass_through
52 } // namespace occ
53 } // namespace open_power
54