X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECTypeUtils.h;h=b5541aa5d9f53b76ae91339882924488e7b2256b;hb=a6aecece9ac8ab218811237f0bb63ccc3166d7c3;hp=4b406f12edf271a641f01f1d9d7855688191932d;hpb=331d659ebc796b60dc460b8160cc100cee043578;p=deb_libcec.git diff --git a/src/lib/CECTypeUtils.h b/src/lib/CECTypeUtils.h index 4b406f1..b5541aa 100644 --- a/src/lib/CECTypeUtils.h +++ b/src/lib/CECTypeUtils.h @@ -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; + } }; }