/*!
* @see cec_transmit
*/
- virtual bool Transmit(const cec_command &data, bool bWaitForAck = true) = 0;
+ virtual bool Transmit(const cec_command &data) = 0;
/*!
* @see cec_set_logical_address
/*!
* @brief Transmit a frame on the CEC line.
* @param data The frame to send.
- * @param bWaitForAck Wait for an ACK message for 1 second after this frame has been sent.
* @return True when the data was sent and acked, false otherwise.
*/
#ifdef __cplusplus
-extern DECLSPEC int cec_transmit(const CEC::cec_command &data, int bWaitForAck = 1);
+extern DECLSPEC int cec_transmit(const CEC::cec_command &data);
#else
-extern DECLSPEC int cec_transmit(const cec_command &data, int bWaitForAck = 1);
+extern DECLSPEC int cec_transmit(const cec_command &data);
#endif
/*!
cec_opcode opcode;
cec_datapacket parameters;
int8_t opcode_set;
+ int32_t ack_timeout;
#ifdef __cplusplus
static void format(cec_command &command, cec_logical_address initiator, cec_logical_address destination, cec_opcode opcode)
command.destination = destination;
command.opcode = opcode;
command.opcode_set = 1;
+ command.ack_timeout = 1000;
}
void push_back(uint8_t data)
eom = 0;
opcode_set = 0;
opcode = CEC_OPCODE_FEATURE_ABORT;
+ ack_timeout = 1000;
parameters.clear();
};
#endif
return m_communication && m_communication->SetAckMask(0x1 << (uint8_t)m_iLogicalAddress);
}
-bool CCECProcessor::Transmit(const cec_command &data, bool bWaitForAck /* = true */)
+bool CCECProcessor::Transmit(const cec_command &data)
{
bool bReturn(false);
LogOutput(data);
}
}
- if (bWaitForAck)
+ if (data.ack_timeout > 0)
{
bool bError(false);
- if ((bReturn = WaitForAck(&bError, output->size(), 1000)) == false)
+ if ((bReturn = WaitForAck(&bError, output->size(), data.ack_timeout)) == false)
m_controller->AddLog(CEC_LOG_ERROR, "did not receive ack");
}
else
virtual bool SetActiveView(void);
virtual bool SetInactiveView(void);
- virtual bool Transmit(const cec_command &data, bool bWaitForAck = true);
+ virtual bool Transmit(const cec_command &data);
virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress);
virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress);
virtual bool SwitchMonitoring(bool bEnable);
return m_commandBuffer.Pop(*command);
}
-bool CLibCEC::Transmit(const cec_command &data, bool bWaitForAck /* = true */)
+bool CLibCEC::Transmit(const cec_command &data)
{
- return m_cec ? m_cec->Transmit(data, bWaitForAck) : false;
+ return m_cec ? m_cec->Transmit(data) : false;
}
bool CLibCEC::SetLogicalAddress(cec_logical_address iLogicalAddress)
virtual bool GetNextKeypress(cec_keypress *key);
virtual bool GetNextCommand(cec_command *command);
- virtual bool Transmit(const cec_command &data, bool bWaitForAck = true);
+ virtual bool Transmit(const cec_command &data);
virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1);
virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
return -1;
}
-int cec_transmit(const CEC::cec_command &data, int bWaitForAck /* = true */)
+int cec_transmit(const CEC::cec_command &data)
{
if (cec_parser)
- return cec_parser->Transmit(data, bWaitForAck == 1) ? 1 : 0;
+ return cec_parser->Transmit(data) ? 1 : 0;
return -1;
}
cec_command command;
cec_command::format(command, GetMyLogicalAddress(), GetLogicalAddress(), CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
- m_processor->Transmit(command, false);
+ command.ack_timeout = 0;
+ m_processor->Transmit(command);
}
}
while (GetWord(input, strvalue) && HexStrToInt(strvalue, ivalue))
bytes.push_back(ivalue);
- parser->Transmit(bytes, command == "tx");
+ if (command == "txn")
+ bytes.ack_timeout = 0;
+
+ parser->Transmit(bytes);
}
else if (command == "on")
{