while (m_persistedConfiguration.iFirmwareVersion == CEC_FW_VERSION_UNKNOWN && iFwVersionTry++ < 3)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting the firmware version");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_FIRMWARE_VERSION);
if (response.size == 2)
m_persistedConfiguration.iFirmwareVersion = (response[0] << 8 | response[1]);
bool CUSBCECAdapterCommands::RequestSettingAutoEnabled(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting autonomous mode setting");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_AUTO_ENABLED);
if (response.size == 1)
bool CUSBCECAdapterCommands::RequestSettingCECVersion(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting CEC version setting");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_HDMI_VERSION);
if (response.size == 1)
{
if (m_adapterType == P8_ADAPTERTYPE_UNKNOWN)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting adapter type");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_ADAPTER_TYPE);
if (response.size == 1)
{
if (m_iBuildDate == CEC_FW_BUILD_UNKNOWN)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting firmware build date");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE);
if (response.size == 4)
bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting default logical address setting");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_DEFAULT_LOGICAL_ADDRESS);
if (response.size == 1)
bool CUSBCECAdapterCommands::RequestSettingDeviceType(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting device type setting");
+#endif
m_persistedConfiguration.deviceTypes.Clear();
cec_datapacket response = RequestSetting(MSGCODE_GET_DEVICE_TYPE);
bool CUSBCECAdapterCommands::RequestSettingLogicalAddressMask(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting logical address mask setting");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_LOGICAL_ADDRESS_MASK);
if (response.size == 2)
bool CUSBCECAdapterCommands::RequestSettingOSDName(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting OSD name setting");
+#endif
memset(m_persistedConfiguration.strDeviceName, 0, 13);
cec_datapacket response = RequestSetting(MSGCODE_GET_OSD_NAME);
bool CUSBCECAdapterCommands::RequestSettingPhysicalAddress(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting physical address setting");
+#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_PHYSICAL_ADDRESS);
if (response.size == 2)
bool CUSBCECAdapterCommands::PingAdapter(void)
{
+#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending ping");
+#endif
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_PING, params);
message.payload[iPtr + 1] = command.parameters.At(iPtr);
}
+#ifdef CEC_DEBUGGING
CStdString strDump;
strDump.Format("len = %d, payload = %X%X", message.length, (int)message.initiator, (int)message.follower);
for (uint8_t iPtr = 0; iPtr < message.length - 1; iPtr++)
strDump.AppendFormat(":%02X", message.payload[iPtr]);
LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending data: %s", strDump.c_str());
+#endif
int iReturn = vc_cec_send_message2(&message);
#else
payload[iPtr + 1] = command.parameters.At(iPtr);
}
+#ifdef CEC_DEBUGGING
CStdString strDump;
strDump.Format("len = %d, payload = %X%X", iLength, (int)command.initiator, (int)command.destination);
for (uint8_t iPtr = 0; iPtr < iLength; iPtr++)
strDump.AppendFormat(":%02X", payload[iPtr]);
LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending data: %s", strDump.c_str());
+#endif
int iReturn = vc_cec_send_message((uint32_t)command.destination, (uint8_t*)&payload, iLength, bIsReply);
#endif