From 9b223b298b838c216281f580c4dc0e62cf8d41f6 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 4 Dec 2011 01:31:06 +0100 Subject: [PATCH] cec: don't retry polls --- include/cectypes.h | 3 +++ src/lib/AdapterCommunication.cpp | 1 + src/lib/devices/CECBusDevice.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/include/cectypes.h b/include/cectypes.h index 0fed3b5..467f150 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -694,6 +694,7 @@ typedef struct cec_command cec_datapacket parameters; int8_t opcode_set; int32_t transmit_timeout; + int8_t retries; #ifdef __cplusplus cec_command &operator =(const struct cec_command &command) @@ -706,6 +707,7 @@ typedef struct cec_command opcode_set = command.opcode_set; transmit_timeout = command.transmit_timeout; parameters = command.parameters; + retries = command.retries; return *this; } @@ -747,6 +749,7 @@ typedef struct cec_command opcode_set = 0; opcode = CEC_OPCODE_FEATURE_ABORT; transmit_timeout = 1000; + retries = 4; parameters.Clear(); }; #endif diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index 3a1cfeb..7f801b6 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -43,6 +43,7 @@ using namespace CEC; CCECAdapterMessage::CCECAdapterMessage(const cec_command &command) { clear(); + maxTries = command.retries + 1; //set ack polarity to high when transmitting to the broadcast address //set ack polarity low when transmitting to any other address diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 7fe92a4..c06a8b8 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -744,6 +744,7 @@ bool CCECBusDevice::TransmitPoll(cec_logical_address dest) cec_command command; cec_command::Format(command, m_iLogicalAddress, dest, CEC_OPCODE_NONE); + command.retries = 0; { CLockObject lock(&m_transmitMutex); -- 2.34.1