#define CEC_POWER_STATE_REFRESH_TIME 30000
#define CEC_FW_VERSION_UNKNOWN 0xFFFF
-#define CEC_DEFAULT_TRANSMIT_TIMEOUT 1000
-#define CEC_DEFAULT_TRANSMIT_WAIT 2000
-#define CEC_DEFAULT_TRANSMIT_RETRIES 1
+#define CEC_DEFAULT_TRANSMIT_RETRY_WAIT 500
+#define CEC_DEFAULT_TRANSMIT_TIMEOUT 1000
+#define CEC_DEFAULT_TRANSMIT_WAIT 2000
+#define CEC_DEFAULT_TRANSMIT_RETRIES 1
#define CEC_MIN_LIB_VERSION 1
#define CEC_LIB_VERSION_MAJOR 1
if (previousDevice && newDevice)
{
newDevice->SetDeviceStatus(CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC);
- previousDevice->SetDeviceStatus(CEC_DEVICE_STATUS_UNKNOWN);
+ previousDevice->SetDeviceStatus(CEC_DEVICE_STATUS_NOT_PRESENT);
newDevice->SetCecVersion(previousDevice->GetCecVersion(false));
previousDevice->SetCecVersion(CEC_VERSION_UNKNOWN);
{
bReturn = m_busDevices[addr]->TransmitActiveSource();
+ if (bReturn)
+ {
+ m_busDevices[addr]->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+ m_busDevices[addr]->TransmitMenuState(CECDEVICE_TV);
+ }
+
if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
m_busDevices[addr]->GetHandler()->SendDeckStatusUpdateOnActiveSource())
if (output->tries > 0)
m_communication->SetLineTimeout(m_iRetryLineTimeout);
bReturn = m_communication->Write(output);
+ if (!bReturn)
+ Sleep(CEC_DEFAULT_TRANSMIT_RETRY_WAIT);
}while (!bReturn && output->transmit_timeout > 0 && output->NeedsRetry() && ++output->tries < output->maxTries);
}
while (!bReturn && ++iTries <= iMaxTries)
{
m_expectedResponse = expectedResponse;
- if (m_processor->Transmit(command))
+ if ((bReturn = m_processor->Transmit(command)))
{
CLibCEC::AddLog(CEC_LOG_DEBUG, "command transmitted");
- bReturn = bExpectResponse ?
- m_condition.Wait(m_receiveMutex, m_iTransmitWait) :
- true;
+ if (bExpectResponse)
+ bReturn = m_condition.Wait(m_receiveMutex, m_iTransmitWait);
}
}
--m_iUseCounter;