repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
win32: download boost deps from xbmc.org
[deb_libcec.git]
/
src
/
lib
/
AdapterCommunication.h
diff --git
a/src/lib/AdapterCommunication.h
b/src/lib/AdapterCommunication.h
index 5e099d8d69d41b1ef8f115dcc14294b494d8f505..2ec6e3b60c3481597f22b6f4894dc6ec6f16bbca 100644
(file)
--- a/
src/lib/AdapterCommunication.h
+++ b/
src/lib/AdapterCommunication.h
@@
-40,17
+40,27
@@
namespace CEC
{
namespace CEC
{
+ typedef enum cec_adapter_message_state
+ {
+ ADAPTER_MESSAGE_STATE_UNKNOWN = 0,
+ ADAPTER_MESSAGE_STATE_WAITING,
+ ADAPTER_MESSAGE_STATE_SENT,
+ ADAPTER_MESSAGE_STATE_RECEIVED,
+ ADAPTER_MESSAGE_STATE_ERROR
+ } cec_adapter_message_state;
+
+
class CCECAdapterMessage : public boost::enable_shared_from_this<CCECAdapterMessage>
{
public:
class CCECAdapterMessage : public boost::enable_shared_from_this<CCECAdapterMessage>
{
public:
- CCECAdapterMessage(void) {}
+ CCECAdapterMessage(void) {
clear();
}
CCECAdapterMessage(const cec_command &command);
bool empty(void) const { return packet.empty(); }
uint8_t operator[](uint8_t pos) const { return packet[pos]; }
uint8_t at(uint8_t pos) const { return packet[pos]; }
uint8_t size(void) const { return packet.size; }
CCECAdapterMessage(const cec_command &command);
bool empty(void) const { return packet.empty(); }
uint8_t operator[](uint8_t pos) const { return packet[pos]; }
uint8_t at(uint8_t pos) const { return packet[pos]; }
uint8_t size(void) const { return packet.size; }
- void clear(void) { packet.clear(); }
+ void clear(void) {
state = ADAPTER_MESSAGE_STATE_UNKNOWN;
packet.clear(); }
void shift(uint8_t iShiftBy) { packet.shift(iShiftBy); }
void push_back(uint8_t add) { packet.push_back(add); }
cec_adapter_messagecode message(void) const { return packet.size >= 1 ? (cec_adapter_messagecode) (packet.at(0) & ~(MSGCODE_FRAME_EOM | MSGCODE_FRAME_ACK)) : MSGCODE_NOTHING; }
void shift(uint8_t iShiftBy) { packet.shift(iShiftBy); }
void push_back(uint8_t add) { packet.push_back(add); }
cec_adapter_messagecode message(void) const { return packet.size >= 1 ? (cec_adapter_messagecode) (packet.at(0) & ~(MSGCODE_FRAME_EOM | MSGCODE_FRAME_ACK)) : MSGCODE_NOTHING; }
@@
-60,7
+70,10
@@
namespace CEC
cec_logical_address destination(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) & 0xF) : CECDEVICE_UNKNOWN; };
void push_escaped(int16_t byte);
cec_logical_address destination(void) const { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) & 0xF) : CECDEVICE_UNKNOWN; };
void push_escaped(int16_t byte);
- cec_datapacket packet;
+ cec_datapacket packet;
+ cec_adapter_message_state state;
+ CMutex mutex;
+ CCondition condition;
private:
CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
private:
CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
@@
-100,5
+113,6
@@
namespace CEC
CecBuffer<CCECAdapterMessagePtr> m_outBuffer;
CMutex m_mutex;
CCondition m_rcvCondition;
CecBuffer<CCECAdapterMessagePtr> m_outBuffer;
CMutex m_mutex;
CCondition m_rcvCondition;
+ CCondition m_startCondition;
};
};
};
};