toshiba: fixed - toshiba handler wasn't initialised, and toshiba uses more than one...
[deb_libcec.git] / src / lib / CECTypeUtils.h
index 4b406f12edf271a641f01f1d9d7855688191932d..b5541aa5d9f53b76ae91339882924488e7b2256b 100644 (file)
@@ -31,6 +31,8 @@
  *     http://www.pulse-eight.net/
  */
 
+#include "lib/platform/util/StdString.h"
+
 namespace CEC
 {
   class CCECTypeUtils
@@ -491,6 +493,7 @@ namespace CEC
       case CEC_VENDOR_SONY:
         return "Sony";
       case CEC_VENDOR_TOSHIBA:
+      case CEC_VENDOR_TOSHIBA2:
         return "Toshiba";
       case CEC_VENDOR_AKAI:
         return "Akai";
@@ -852,5 +855,16 @@ namespace CEC
       }
       return true;
     }
+
+    static CStdString ToString(const cec_command& command)
+    {
+      CStdString dataStr;
+      dataStr.Format(">> %1x%1x", command.initiator, command.destination);
+      if (command.opcode_set == 1)
+        dataStr.AppendFormat(":%02x", command.opcode);
+      for (uint8_t iPtr = 0; iPtr < command.parameters.size; iPtr++)
+        dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]);
+      return dataStr;
+    }
   };
 }