repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cec: sleep a bit longer while doing a bus scan
[deb_libcec.git]
/
src
/
lib
/
AdapterCommunication.cpp
diff --git
a/src/lib/AdapterCommunication.cpp
b/src/lib/AdapterCommunication.cpp
index d6655616502c04fa8131ef7e330ef4b48acae947..32ceeafc02e5835be628af9a2d8e140056c838b0 100644
(file)
--- a/
src/lib/AdapterCommunication.cpp
+++ b/
src/lib/AdapterCommunication.cpp
@@
-215,8
+215,7
@@
CStdString CCECAdapterMessage::ToString(void) const
bool CCECAdapterMessage::is_error(void) const
{
cec_adapter_messagecode code = message();
bool CCECAdapterMessage::is_error(void) const
{
cec_adapter_messagecode code = message();
- return (code == MSGCODE_TIMEOUT_ERROR ||
- code == MSGCODE_HIGH_ERROR ||
+ return (code == MSGCODE_HIGH_ERROR ||
code == MSGCODE_LOW_ERROR ||
code == MSGCODE_RECEIVE_FAILED ||
code == MSGCODE_COMMAND_REJECTED ||
code == MSGCODE_LOW_ERROR ||
code == MSGCODE_RECEIVE_FAILED ||
code == MSGCODE_COMMAND_REJECTED ||
@@
-362,7
+361,6
@@
void CAdapterCommunication::WriteNextCommand(void)
void CAdapterCommunication::SendMessageToAdapter(CCECAdapterMessage *msg)
{
void CAdapterCommunication::SendMessageToAdapter(CCECAdapterMessage *msg)
{
- bool bReturn(true);
CLockObject lock(&msg->mutex);
if (m_port->Write(msg) != (int32_t) msg->size())
{
CLockObject lock(&msg->mutex);
if (m_port->Write(msg) != (int32_t) msg->size())
{
@@
-374,7
+372,7
@@
void CAdapterCommunication::SendMessageToAdapter(CCECAdapterMessage *msg)
else
{
m_controller->AddLog(CEC_LOG_DEBUG, "command sent");
else
{
m_controller->AddLog(CEC_LOG_DEBUG, "command sent");
- CCondition::Sleep((uint32_t) msg->size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/
+ 10
);
+ CCondition::Sleep((uint32_t) msg->size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/);
msg->state = ADAPTER_MESSAGE_STATE_SENT;
}
msg->condition.Signal();
msg->state = ADAPTER_MESSAGE_STATE_SENT;
}
msg->condition.Signal();
@@
-415,7
+413,8
@@
bool CAdapterCommunication::Read(CCECAdapterMessage &msg, uint32_t iTimeout)
}
else if (buf == MSGSTART) //we found a msgstart before msgend, this is not right, remove
{
}
else if (buf == MSGSTART) //we found a msgstart before msgend, this is not right, remove
{
- m_controller->AddLog(CEC_LOG_ERROR, "received MSGSTART before MSGEND");
+ if (msg.size() > 0)
+ m_controller->AddLog(CEC_LOG_WARNING, "received MSGSTART before MSGEND, removing previous buffer contents");
msg.clear();
bGotStart = true;
}
msg.clear();
bGotStart = true;
}