Implement org.open_power.OCC.PassThrough.Send

The Send method accepts a command as an array of hex strings, and
returns the response as an another array of hex strings.

For now, Send just logs the command array to the journal.

Change-Id: Iff288d36075833b8c615cdb18b78395839e1e2da
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index aef0e04..872e281 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -1,5 +1,6 @@
 #include <memory>
-#include <iostream>
+#include <algorithm>
+#include <phosphor-logging/log.hpp>
 #include "occ_pass_through.hpp"
 #include "occ_finder.hpp"
 
@@ -45,6 +46,25 @@
 
 std::vector<int32_t> PassThrough::send(std::vector<int32_t> command)
 {
+    std::string msg = "Pass through to OCC ";
+    msg += path;
+
+    std::string cmd;
+    std::for_each(command.cbegin(), command.cend(),
+                  [&cmd](const auto& c)
+                  {
+                      cmd += std::to_string(c);
+                      cmd += ',';
+                  });
+    if (!cmd.empty())
+    {
+        // Remove trailing ','
+        cmd.pop_back();
+    }
+
+    using namespace phosphor::logging;
+    log<level::INFO>(msg.c_str(), entry("COMMAND=%s", cmd.c_str()));
+
     return {};
 }