X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=blobdiff_plain;f=src%2Flib%2FCECTypeUtils.h;h=68ef5d1838406793d77021a14e9b19decf0f0cfa;hp=4b406f12edf271a641f01f1d9d7855688191932d;hb=8187ac5fe2c685758c679b7d75c26795aa447c9c;hpb=6b4d1b3a3a5d4c4790234e3f8fa8a8da5a3221d7 diff --git a/src/lib/CECTypeUtils.h b/src/lib/CECTypeUtils.h index 4b406f1..68ef5d1 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 @@ -852,5 +854,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; + } }; }