cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_IMAGE_VIEW_ON);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitStandby(const cec_logical_address iInitiator, const cec_logical_address iDestination)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_STANDBY);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitRequestCecVersion(const cec_logical_address iInitiator, const cec_logical_address iDestination)
command.parameters.PushBack((uint8_t) ((iPhysicalAddress >> 8) & 0xFF));
command.parameters.PushBack((uint8_t) (iPhysicalAddress & 0xFF));
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitCECVersion(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_version cecVersion)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_CEC_VERSION);
command.parameters.PushBack((uint8_t)cecVersion);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitInactiveSource(const cec_logical_address iInitiator, uint16_t iPhysicalAddress)
command.parameters.PushBack((iPhysicalAddress >> 8) & 0xFF);
command.parameters.PushBack(iPhysicalAddress & 0xFF);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitMenuState(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_menu_state menuState)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_MENU_STATUS);
command.parameters.PushBack((uint8_t)menuState);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitOSDName(const cec_logical_address iInitiator, const cec_logical_address iDestination, CStdString strDeviceName)
for (unsigned int iPtr = 0; iPtr < strDeviceName.length(); iPtr++)
command.parameters.PushBack(strDeviceName.at(iPtr));
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitOSDString(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_display_control duration, const char *strMessage)
for (unsigned int iPtr = 0; iPtr < iLen; iPtr++)
command.parameters.PushBack(strMessage[iPtr]);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitPhysicalAddress(const cec_logical_address iInitiator, uint16_t iPhysicalAddress, cec_device_type type)
command.parameters.PushBack((uint8_t) (iPhysicalAddress & 0xFF));
command.parameters.PushBack((uint8_t) (type));
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitPoll(const cec_logical_address iInitiator, const cec_logical_address iDestination)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_REPORT_POWER_STATUS);
command.parameters.PushBack((uint8_t) state);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, uint64_t iVendorId)
command.parameters.PushBack((uint8_t) (((uint64_t)iVendorId >> 8) & 0xFF));
command.parameters.PushBack((uint8_t) ((uint64_t)iVendorId & 0xFF));
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint8_t state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_REPORT_AUDIO_STATUS);
command.parameters.PushBack(state);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitSetSystemAudioMode(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SET_SYSTEM_AUDIO_MODE);
command.parameters.PushBack((uint8_t)state);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitSystemAudioModeStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS);
command.parameters.PushBack((uint8_t)state);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitDeckStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_deck_info state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_DECK_STATUS);
command.PushBack((uint8_t)state);
- return Transmit(command);
+ return Transmit(command, false);
}
bool CCECCommandHandler::TransmitKeypress(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_user_control_code key, bool bWait /* = true */)
command.transmit_timeout = m_iTransmitTimeout;
{
+ uint8_t iTries(0), iMaxTries(command.opcode == CEC_OPCODE_NONE ? 1 : m_iTransmitRetries);
CLockObject writeLock(&m_processor->m_transmitMutex);
CLockObject receiveLock(&m_receiveMutex);
++m_iUseCounter;
- if (m_processor->Transmit(command))
+ while (!bReturn && ++iTries <= iMaxTries)
{
- bReturn = bExpectResponse ?
- m_condition.Wait(&m_receiveMutex, m_iTransmitWait) :
- true;
+ if (m_processor->Transmit(command))
+ {
+ m_processor->AddLog(CEC_LOG_DEBUG, "command transmitted");
+ bReturn = bExpectResponse ?
+ m_condition.Wait(&m_receiveMutex, m_iTransmitWait) :
+ true;
+ }
}
--m_iUseCounter;
}
response.PushBack(SL_COMMAND_UNKNOWN_02);
response.PushBack(SL_COMMAND_UNKNOWN_03);
- Transmit(response);
+ Transmit(response, false);
}
void CSLCommandHandler::TransmitVendorCommand05(const cec_logical_address iSource, const cec_logical_address iDestination)
cec_command::Format(response, iSource, iDestination, CEC_OPCODE_VENDOR_COMMAND);
response.PushBack(SL_COMMAND_CONNECT_ACCEPT);
response.PushBack((uint8_t)iSource);
- Transmit(response);
+ Transmit(response, false);
}
void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
response.parameters.PushBack((uint8_t) (((uint64_t)CEC_VENDOR_LG >> 8) & 0xFF));
response.parameters.PushBack((uint8_t) ((uint64_t)CEC_VENDOR_LG & 0xFF));
- Transmit(response);
+ Transmit(response, false);
cec_command::Format(response, iInitiator, iDestination, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
Transmit(response);
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_VENDOR_COMMAND);
command.parameters.PushBack((uint8_t)SL_COMMAND_POWER_ON);
command.parameters.PushBack(0x00);
- return Transmit(command);
+ return Transmit(command, false);
}
return CCECCommandHandler::TransmitImageViewOn(iInitiator, iDestination);