X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=blobdiff_plain;f=src%2Flib%2Fadapter%2FPulse-Eight%2FUSBCECAdapterCommunication.cpp;h=2e9c790a7342cce914c28eb29c4e8ba031c33712;hp=07255a79c84fa5c52500d0da6362a048c95c3e1e;hb=f7539eaf1ed0a488c0a93998c9b178d435014c51;hpb=0af33bf66fc03c7d4e2303d9ff93b16bcb07b808 diff --git a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp index 07255a7..2e9c790 100644 --- a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp @@ -382,8 +382,7 @@ bool CUSBCECAdapterCommunication::WriteToDevice(CCECAdapterMessage *message) { LIB_CEC->AddLog(CEC_LOG_DEBUG, "error writing command '%s' to serial port '%s': %s", CCECAdapterMessage::ToString(message->Message()), m_port->GetName().c_str(), m_port->GetError().c_str()); message->state = ADAPTER_MESSAGE_STATE_ERROR; - // this will trigger an alert in the reader thread - m_port->Close(); + // let the higher level close the port return false; } @@ -416,7 +415,7 @@ bool CUSBCECAdapterCommunication::ReadFromDevice(uint32_t iTimeout, size_t iSize if (m_port->GetErrorNumber()) { LIB_CEC->AddLog(CEC_LOG_ERROR, "error reading from serial port: %s", m_port->GetError().c_str()); - m_port->Close(); + // let the higher level close the port return false; } } @@ -729,6 +728,11 @@ void *CAdapterPingThread::Process(void) /* failed to ping the adapter 3 times in a row. something must be wrong with the connection */ m_com->LIB_CEC->AddLog(CEC_LOG_ERROR, "failed to ping the adapter 3 times in a row. closing the connection."); m_com->StopThread(false); + + libcec_parameter param; + param.paramData = NULL; param.paramType = CEC_PARAMETER_TYPE_UNKOWN; + m_com->LIB_CEC->Alert(CEC_ALERT_CONNECTION_LOST, param); + break; } }