summaryrefslogtreecommitdiffstats
path: root/occ_pass_through.cpp
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-18 01:09:28 -0500
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-30 05:55:09 -0500
commit6b492fbf372aca6100c6c24cb1f574de7eb81ec2 (patch)
tree96991c68c61ba57a89251c9de2f85dc5b70df693 /occ_pass_through.cpp
parent4779531d50f55d2ecbf173b8aca76ce545a77477 (diff)
downloadopenpower-occ-control-6b492fbf372aca6100c6c24cb1f574de7eb81ec2.tar.gz
openpower-occ-control-6b492fbf372aca6100c6c24cb1f574de7eb81ec2.zip
Implement org.open_power.OCC.PassThrough
This d-bus interface is implemented by the open_power::occ::pass_through::PassThrough class. Change-Id: I6bce9e609b7b977418bcfee15e97432cb7d9e6b3 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'occ_pass_through.cpp')
-rw-r--r--occ_pass_through.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
new file mode 100644
index 0000000..aef0e04
--- /dev/null
+++ b/occ_pass_through.cpp
@@ -0,0 +1,53 @@
+#include <memory>
+#include <iostream>
+#include "occ_pass_through.hpp"
+#include "occ_finder.hpp"
+
+namespace open_power
+{
+namespace occ
+{
+namespace pass_through
+{
+
+void run()
+{
+ auto bus = sdbusplus::bus::new_default();
+ sdbusplus::server::manager::manager objManager(bus,
+ OCC_PASS_THROUGH_ROOT);
+
+ std::vector<std::unique_ptr<PassThrough>> objects;
+ auto occs = open_power::occ::finder::get();
+
+ for (const auto& occ : occs)
+ {
+ auto occPassThrough = object(occ);
+ objects.emplace_back(
+ std::make_unique<PassThrough>(bus, occPassThrough.c_str()));
+ }
+ bus.request_name(OCC_PASS_THROUGH_BUSNAME);
+
+ while (true)
+ {
+ bus.process_discard();
+ bus.wait();
+ }
+}
+
+PassThrough::PassThrough(
+ sdbusplus::bus::bus& bus,
+ const char* path) :
+ Iface(bus, path),
+ path(path)
+{
+ this->emit_object_added();
+}
+
+std::vector<int32_t> PassThrough::send(std::vector<int32_t> command)
+{
+ return {};
+}
+
+} // namespace pass_through
+} // namespace occ
+} // namespace open_power
OpenPOWER on IntegriCloud