X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=c37bed2161570a1c85ea0e1956af2759eef86172;hb=21b8a4e9e826d33b8dedab02bf9420451a65196e;hp=5ea6bd5de62d9501daded2a4b64db06d491781fb;hpb=7cc92235bb5794e28b7bdb6f057b9e6a4c160f2d;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 5ea6bd5..c37bed2 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -280,7 +280,10 @@ bool CCECProcessor::Initialise(void) CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set the physical address to %4x", m_configuration.iPhysicalAddress); } else if (m_configuration.iPhysicalAddress == 0 && (bReturn = SetHDMIPort(m_configuration.baseDevice, m_configuration.iHDMIPort, true)) == false) + { CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set HDMI port %d on %s (%x)", m_configuration.iHDMIPort, ToString(m_configuration.baseDevice), (uint8_t)m_configuration.baseDevice); + bReturn = true; + } if (bReturn && m_configuration.bActivateSource == 1) m_busDevices[m_configuration.logicalAddresses.primary]->ActivateSource(); @@ -643,9 +646,12 @@ bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, } if (!bReturn) - CLibCEC::AddLog(CEC_LOG_ERROR, "failed to set the physical address"); - else - SetPhysicalAddress(iPhysicalAddress); + { + CLibCEC::AddLog(CEC_LOG_WARNING, "failed to set the physical address to %04X, setting it to the default value %04X", iPhysicalAddress, CEC_DEFAULT_PHYSICAL_ADDRESS); + iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS; + } + + SetPhysicalAddress(iPhysicalAddress); return bReturn; } @@ -1509,9 +1515,9 @@ const char *CCECProcessor::ToString(const cec_server_version version) bool CCECProcessor::StartBootloader(const char *strPort /* = NULL */) { + bool bReturn(false); if (!m_communication && strPort) { - bool bReturn(false); IAdapterCommunication *comm = new CUSBCECAdapterCommunication(this, strPort); CTimeout timeout(CEC_DEFAULT_CONNECT_TIMEOUT); int iConnectTry(0); @@ -1530,8 +1536,12 @@ bool CCECProcessor::StartBootloader(const char *strPort /* = NULL */) } else { - return m_communication->StartBootloader(); + m_communication->StartBootloader(); + Close(); + bReturn = true; } + + return bReturn; } bool CCECProcessor::PingAdapter(void)