+ {
+ uint8_t iTries(0), iMaxTries(command.opcode == CEC_OPCODE_NONE ? 1 : m_iTransmitRetries + 1);
+ while (!bReturn && ++iTries <= iMaxTries)
+ {
+ if ((bReturn = m_processor->Transmit(command)) == true)
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "command transmitted");
+ if (bExpectResponse)
+ {
+ bReturn = m_waitForResponse->Wait(expectedResponse);
+ CLibCEC::AddLog(CEC_LOG_DEBUG, bReturn ? "expected response received (%X: %s)" : "expected response not received (%X: %s)", (int)expectedResponse, m_processor->ToString(expectedResponse));
+ }
+ }
+ }
+ }
+
+ return bReturn;
+}
+
+bool CCECCommandHandler::ActivateSource(void)
+{
+ if (m_busDevice->IsActiveSource() &&
+ m_busDevice->GetStatus(false) == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC)
+ {
+ m_busDevice->SetPowerStatus(CEC_POWER_STATUS_ON);
+ m_busDevice->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+
+ m_busDevice->TransmitImageViewOn();
+ m_busDevice->TransmitActiveSource();
+ m_busDevice->TransmitMenuState(CECDEVICE_TV);
+ if ((m_busDevice->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
+ m_busDevice->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
+ SendDeckStatusUpdateOnActiveSource())
+ ((CCECPlaybackDevice *)m_busDevice)->TransmitDeckStatus(CECDEVICE_TV);
+ m_bHandlerInited = true;
+ }
+ return true;