From: Lars Op den Kamp Date: Sun, 4 Dec 2011 00:31:06 +0000 (+0100) Subject: cec: don't retry polls X-Git-Tag: upstream/2.2.0~1^2~44^2~55 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9b223b298b838c216281f580c4dc0e62cf8d41f6;p=deb_libcec.git cec: don't retry polls --- 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);