cec_datapacket parameters;
int8_t opcode_set;
int32_t transmit_timeout;
- int8_t retries;
#ifdef __cplusplus
cec_command &operator =(const struct cec_command &command)
opcode_set = command.opcode_set;
transmit_timeout = command.transmit_timeout;
parameters = command.parameters;
- retries = command.retries;
return *this;
}
opcode_set = 0;
opcode = CEC_OPCODE_FEATURE_ABORT;
transmit_timeout = CEC_DEFAULT_TRANSMIT_TIMEOUT;
- retries = CEC_DEFAULT_TRANSMIT_RETRIES;
parameters.Clear();
};
#endif
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
LogOutput(data);
CCECAdapterMessage *output = new CCECAdapterMessage(data);
+
+ /* set the number of retries */
+ if (data.opcode == CEC_OPCODE_NONE)
+ output->maxTries = 1;
+ else if (data.initiator != CECDEVICE_BROADCAST)
+ output->maxTries = m_busDevices[data.initiator]->GetHandler()->GetTransmitRetries() + 1;
+
bReturn = Transmit(output);
/* set to "not present" on failed ack */
bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /* = true */)
{
command.transmit_timeout = m_iTransmitTimeout;
- if (command.retries == CEC_DEFAULT_TRANSMIT_RETRIES)
- command.retries = m_iTransmitRetries;
CLockObject writeLock(&m_processor->m_transmitMutex);
CLockObject receiveLock(&m_receiveMutex);
virtual bool HandleReceiveFailed(void);
virtual bool InitHandler(void) { return true; }
+ virtual uint8_t GetTransmitRetries(void) const { return m_iTransmitRetries; }
virtual bool TransmitPowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination);
virtual bool TransmitStandby(const cec_logical_address iInitiator, const cec_logical_address iDestination);