m_iLastTransmission(0)
{
m_configuration.Clear();
- m_configuration.serverVersion = CEC_SERVER_VERSION_1_5_1;
+ m_configuration.serverVersion = CEC_SERVER_VERSION_1_5_2;
// client version < 1.5.0
m_configuration.clientVersion = (uint32_t)CEC_CLIENT_VERSION_PRE_1_5;
{
CLibCEC::AddLog(CEC_LOG_ERROR, "could not open a connection (try %d)", ++iConnectTry);
m_communication->Close();
- Sleep(500);
+ CEvent::Sleep(1000);
}
if (bReturn)
return "1.5.0";
case CEC_CLIENT_VERSION_1_5_1:
return "1.5.1";
+ case CEC_CLIENT_VERSION_1_5_2:
+ return "1.5.2";
default:
return "Unknown";
}
case CEC_SERVER_VERSION_1_5_0:
return "1.5.0";
case CEC_SERVER_VERSION_1_5_1:
- return "1.5.1";
+ return "1.5.1";
+ case CEC_SERVER_VERSION_1_5_2:
+ return "1.5.2";
default:
return "Unknown";
}
}
}
-bool CCECProcessor::StartBootloader(void)
+bool CCECProcessor::StartBootloader(const char *strPort /* = NULL */)
{
- return m_communication->StartBootloader();
+ if (!m_communication && strPort)
+ {
+ bool bReturn(false);
+ IAdapterCommunication *comm = new CUSBCECAdapterCommunication(this, strPort);
+ CTimeout timeout(10000);
+ int iConnectTry(0);
+ while (timeout.TimeLeft() > 0 && (bReturn = comm->Open(NULL, (timeout.TimeLeft() / CEC_CONNECT_TRIES)), true) == false)
+ {
+ CLibCEC::AddLog(CEC_LOG_ERROR, "could not open a connection (try %d)", ++iConnectTry);
+ comm->Close();
+ Sleep(500);
+ }
+ if (comm->IsOpen())
+ {
+ bReturn = comm->StartBootloader();
+ delete comm;
+ }
+ return bReturn;
+ }
+ else
+ {
+ return m_communication->StartBootloader();
+ }
}
bool CCECProcessor::PingAdapter(void)
else
return SetHDMIPort(m_configuration.baseDevice, m_configuration.iHDMIPort);
}
+ else if (m_configuration.bActivateSource == 1 && IsRunning() && !IsActiveSource(m_logicalAddresses.primary))
+ {
+ // activate the source if we're not already the active source
+ SetActiveSource(m_configuration.deviceTypes.types[0]);
+ }
return true;
}