repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0e7b6c5
)
cec: removed framebuffer in CCECProcessor. any other packet is an unexpected reply
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 31 Oct 2011 00:40:13 +0000
(
01:40
+0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 31 Oct 2011 00:40:13 +0000
(
01:40
+0100)
src/lib/AdapterCommunication.cpp
patch
|
blob
|
blame
|
history
src/lib/AdapterCommunication.h
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.h
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/AdapterCommunication.cpp
b/src/lib/AdapterCommunication.cpp
index 74597665cfb98910423ea35f01562adce47c2dc6..0fee28b50c3a187c7d05268c162b0ba5dc0a7e32 100644
(file)
--- a/
src/lib/AdapterCommunication.cpp
+++ b/
src/lib/AdapterCommunication.cpp
@@
-85,6
+85,7
@@
CCECAdapterMessage::CCECAdapterMessage(const cec_command &command)
CCECAdapterMessage &CCECAdapterMessage::operator =(const CCECAdapterMessage &msg)
{
packet = msg.packet;
CCECAdapterMessage &CCECAdapterMessage::operator =(const CCECAdapterMessage &msg)
{
packet = msg.packet;
+ state = msg.state;
return *this;
}
return *this;
}
diff --git
a/src/lib/AdapterCommunication.h
b/src/lib/AdapterCommunication.h
index 2ec6e3b60c3481597f22b6f4894dc6ec6f16bbca..73b3bd22633bc4203d49945f86970f806ad150d6 100644
(file)
--- a/
src/lib/AdapterCommunication.h
+++ b/
src/lib/AdapterCommunication.h
@@
-55,6
+55,7
@@
namespace CEC
public:
CCECAdapterMessage(void) { clear(); }
CCECAdapterMessage(const cec_command &command);
public:
CCECAdapterMessage(void) { clear(); }
CCECAdapterMessage(const cec_command &command);
+ CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
bool empty(void) const { return packet.empty(); }
uint8_t operator[](uint8_t pos) const { return packet[pos]; }
bool empty(void) const { return packet.empty(); }
uint8_t operator[](uint8_t pos) const { return packet[pos]; }
@@
-74,9
+75,6
@@
namespace CEC
cec_adapter_message_state state;
CMutex mutex;
CCondition condition;
cec_adapter_message_state state;
CMutex mutex;
CCondition condition;
-
- private:
- CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
};
typedef boost::shared_ptr<CCECAdapterMessage> CCECAdapterMessagePtr;
};
typedef boost::shared_ptr<CCECAdapterMessage> CCECAdapterMessagePtr;
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index 79cee667a9bd5f497d0cfcf0229cb9688993bf76..f0f951eba37fdb66358250a7079f9c436bdde09e 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-114,13
+114,9
@@
void *CCECProcessor::Process(void)
{
CLockObject lock(&m_mutex);
{
CLockObject lock(&m_mutex);
- CCECAdapterMessagePtr msgPtr;
- if (m_frameBuffer.Pop(msgPtr))
- bParseFrame = ParseMessage(*msgPtr.get());
- else if (m_communication->IsOpen() && m_communication->Read(msg, 50))
- bParseFrame = ParseMessage(msg);
+ if (m_communication->IsOpen() && m_communication->Read(msg, 50))
+ bParseFrame = ParseMessage(msg) && !IsStopped();
- bParseFrame &= !IsStopped();
if (bParseFrame)
command = m_currentframe;
}
if (bParseFrame)
command = m_currentframe;
}
@@
-365,8
+361,10
@@
bool CCECProcessor::WaitForAck(bool *bError, uint8_t iLength, uint32_t iTimeout
*bError = true;
break;
default:
*bError = true;
break;
default:
- CCECAdapterMessagePtr msgPtr = CCECAdapterMessagePtr(new CCECAdapterMessage(msg));
- m_frameBuffer.Push(msgPtr);
+ CStdString strLog;
+ strLog.Format("received unexpected reply '%2x'", msg.message());
+ m_controller->AddLog(CEC_LOG_WARNING, strLog);
+ *bError = true;
break;
}
break;
}
diff --git
a/src/lib/CECProcessor.h
b/src/lib/CECProcessor.h
index 6c62c9f283c5b998210a7cd6625da51b619b57da..fa5d6fefeabecec5d81a674661b17aee26e571a2 100644
(file)
--- a/
src/lib/CECProcessor.h
+++ b/
src/lib/CECProcessor.h
@@
-87,7
+87,6
@@
namespace CEC
cec_command m_currentframe;
cec_logical_address m_iLogicalAddress;
cec_command m_currentframe;
cec_logical_address m_iLogicalAddress;
- CecBuffer<CCECAdapterMessagePtr> m_frameBuffer;
std::string m_strDeviceName;
CMutex m_mutex;
CCondition m_startCondition;
std::string m_strDeviceName;
CMutex m_mutex;
CCondition m_startCondition;