repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cec: don't send a 'disconnected' alert when the close method is called
[deb_libcec.git]
/
src
/
lib
/
adapter
/
USBCECAdapterCommunication.cpp
diff --git
a/src/lib/adapter/USBCECAdapterCommunication.cpp
b/src/lib/adapter/USBCECAdapterCommunication.cpp
index 680918d3f427e9098487e81912164ef5ea9ea7fb..5c2653ade2c67070cfd5d02cddda73e3aac9372c 100644
(file)
--- a/
src/lib/adapter/USBCECAdapterCommunication.cpp
+++ b/
src/lib/adapter/USBCECAdapterCommunication.cpp
@@
-188,10
+188,6
@@
void CUSBCECAdapterCommunication::Close(void)
/* close and delete the com port connection */
if (m_port)
m_port->Close();
/* close and delete the com port connection */
if (m_port)
m_port->Close();
-
- libcec_parameter param;
- param.paramData = NULL; param.paramType = CEC_PARAMETER_TYPE_UNKOWN;
- LIB_CEC->Alert(CEC_ALERT_CONNECTION_LOST, param);
}
cec_adapter_message_state CUSBCECAdapterCommunication::Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout)
}
cec_adapter_message_state CUSBCECAdapterCommunication::Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout)
@@
-224,7
+220,13
@@
void *CUSBCECAdapterCommunication::Process(void)
{
/* read from the serial port */
if (!ReadFromDevice(50, 5))
{
/* read from the serial port */
if (!ReadFromDevice(50, 5))
+ {
+ libcec_parameter param;
+ param.paramData = NULL; param.paramType = CEC_PARAMETER_TYPE_UNKOWN;
+ LIB_CEC->Alert(CEC_ALERT_CONNECTION_LOST, param);
+
break;
break;
+ }
/* TODO sleep 5 ms so other threads can get a lock */
Sleep(5);
/* TODO sleep 5 ms so other threads can get a lock */
Sleep(5);
@@
-384,7
+386,13
@@
CCECAdapterMessage *CUSBCECAdapterCommunication::SendCommand(cec_adapter_message
if (!m_adapterMessageQueue->Write(output))
{
if (output->state == ADAPTER_MESSAGE_STATE_ERROR)
if (!m_adapterMessageQueue->Write(output))
{
if (output->state == ADAPTER_MESSAGE_STATE_ERROR)
+ {
+ libcec_parameter param;
+ param.paramData = NULL; param.paramType = CEC_PARAMETER_TYPE_UNKOWN;
+ LIB_CEC->Alert(CEC_ALERT_CONNECTION_LOST, param);
+
Close();
Close();
+ }
return output;
}
else
return output;
}
else