cec: only wait for multiple 'command accepted' response when sending a transmit comma...
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 8 Mar 2012 19:21:42 +0000 (20:21 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 8 Mar 2012 19:21:42 +0000 (20:21 +0100)
src/lib/adapter/USBCECAdapterCommunication.cpp

index 030d643516c5c52e8e0772ba4cd8b162c52469d3..20f480b09b97310728c0f1322a9757b57bcfc9a9 100644 (file)
@@ -823,7 +823,7 @@ bool CUSBCECAdapterCommunication::WaitForAck(CCECAdapterMessage &message)
 {
   bool bError(false);
   bool bTransmitSucceeded(false);
-  uint8_t iPacketsLeft(message.Size() / 4);
+  uint8_t iPacketsLeft(message.isTransmission ? message.Size() / 4 : 1);
 
   int64_t iNow = GetTimeMs();
   int64_t iTargetTime = iNow + (message.transmit_timeout <= 5 ? CEC_DEFAULT_TRANSMIT_WAIT : message.transmit_timeout);