X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECTypeUtils.h;h=68ef5d1838406793d77021a14e9b19decf0f0cfa;hb=8187ac5fe2c685758c679b7d75c26795aa447c9c;hp=f0887963c97de8c4295d19b21eb37691a78a665b;hpb=2b44051cbfa70deafc30d9767323214debbc1a75;p=deb_libcec.git diff --git a/src/lib/CECTypeUtils.h b/src/lib/CECTypeUtils.h index f088796..68ef5d1 100644 --- a/src/lib/CECTypeUtils.h +++ b/src/lib/CECTypeUtils.h @@ -2,7 +2,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -31,6 +31,8 @@ * http://www.pulse-eight.net/ */ +#include "lib/platform/util/StdString.h" + namespace CEC { class CCECTypeUtils @@ -510,6 +512,10 @@ namespace CEC return "Vizio"; case CEC_VENDOR_BROADCOM: return "Broadcom"; + case CEC_VENDOR_LOEWE: + return "Loewe"; + case CEC_VENDOR_DENON: + return "Denon"; default: return "Unknown"; } @@ -545,6 +551,30 @@ namespace CEC return "1.7.2"; case CEC_CLIENT_VERSION_1_8_0: return "1.8.0"; + case CEC_CLIENT_VERSION_1_8_1: + return "1.8.1"; + case CEC_CLIENT_VERSION_1_8_2: + return "1.8.2"; + case CEC_CLIENT_VERSION_1_9_0: + return "1.9.0"; + case CEC_CLIENT_VERSION_1_99_0: + return "2.0.0-pre"; + case CEC_CLIENT_VERSION_2_0_0: + return "2.0.0"; + case CEC_CLIENT_VERSION_2_0_1: + return "2.0.1"; + case CEC_CLIENT_VERSION_2_0_2: + return "2.0.2"; + case CEC_CLIENT_VERSION_2_0_3: + return "2.0.3"; + case CEC_CLIENT_VERSION_2_0_4: + return "2.0.4"; + case CEC_CLIENT_VERSION_2_0_5: + return "2.0.5"; + case CEC_CLIENT_VERSION_2_1_0: + return "2.1.0"; + case CEC_CLIENT_VERSION_2_1_1: + return "2.1.1"; default: return "Unknown"; } @@ -580,6 +610,30 @@ namespace CEC return "1.7.2"; case CEC_SERVER_VERSION_1_8_0: return "1.8.0"; + case CEC_SERVER_VERSION_1_8_1: + return "1.8.1"; + case CEC_SERVER_VERSION_1_8_2: + return "1.8.2"; + case CEC_SERVER_VERSION_1_9_0: + return "1.9.0"; + case CEC_SERVER_VERSION_1_99_0: + return "2.0.0-pre"; + case CEC_SERVER_VERSION_2_0_0: + return "2.0.0"; + case CEC_SERVER_VERSION_2_0_1: + return "2.0.1"; + case CEC_SERVER_VERSION_2_0_2: + return "2.0.2"; + case CEC_SERVER_VERSION_2_0_3: + return "2.0.3"; + case CEC_SERVER_VERSION_2_0_4: + return "2.0.4"; + case CEC_SERVER_VERSION_2_0_5: + return "2.0.5"; + case CEC_SERVER_VERSION_2_1_0: + return "2.1.0"; + case CEC_SERVER_VERSION_2_1_1: + return "2.1.1"; default: return "Unknown"; } @@ -772,5 +826,44 @@ namespace CEC return "unknown"; } } + + static const char *ToString(const cec_adapter_type type) + { + switch (type) + { + case ADAPTERTYPE_P8_EXTERNAL: + return "Pulse-Eight USB-CEC Adapter"; + case ADAPTERTYPE_P8_DAUGHTERBOARD: + return "Pulse-Eight USB-CEC Daughterboard"; + case ADAPTERTYPE_RPI: + return "Raspberry Pi"; + case ADAPTERTYPE_TDA995x: + return "TDA995x"; + default: + return "unknown"; + } + } + + static bool PhysicalAddressIsIncluded(uint16_t iParent, uint16_t iChild) + { + for (int iPtr = 3; iPtr >= 0; iPtr--) + { + if (((iParent >> 4*iPtr) & 0xF) > 0 && + ((iParent >> 4*iPtr) & 0xF) != ((iChild >> 4*iPtr) & 0xF)) + return false; + } + 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; + } }; }