cec: don't retry polls
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 4 Dec 2011 00:31:06 +0000 (01:31 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 4 Dec 2011 02:28:26 +0000 (03:28 +0100)
include/cectypes.h
src/lib/AdapterCommunication.cpp
src/lib/devices/CECBusDevice.cpp

index 0fed3b56723e76053de3c367a7e058513e96f9ca..467f15049a422f8e9945130ab0a7d8706029a65d 100644 (file)
@@ -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
index 3a1cfeb735b022749de36aa61cb18f4622d62d02..7f801b62d2bf8162b652f39d25621f9f99631d7c 100644 (file)
@@ -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
index 7fe92a451236ec893e89ef47fd213e5ae164fb56..c06a8b8e777c057eac616cdadfc3fe79cb9b2fe4 100644 (file)
@@ -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);