From: Lars Op den Kamp Date: Sat, 29 Oct 2011 15:22:43 +0000 (+0200) Subject: cec: removed TransmitFormatted() X-Git-Tag: upstream/2.2.0~1^2~188 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=13929cffe20a14024ab52a2f93b4edd414e129d1;p=deb_libcec.git cec: removed TransmitFormatted() --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index e15b234..c73c02d 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -147,14 +147,6 @@ void CCECProcessor::LogOutput(const cec_command &data) m_controller->AddLog(CEC_LOG_TRAFFIC, strTx.c_str()); } -bool CCECProcessor::Transmit(const cec_command &data, bool bWaitForAck /* = true */) -{ - LogOutput(data); - - CCECAdapterMessage output(data); - return TransmitFormatted(output, bWaitForAck); -} - bool CCECProcessor::SetLogicalAddress(cec_logical_address iLogicalAddress) { CStdString strLog; @@ -184,11 +176,15 @@ bool CCECProcessor::SwitchMonitoring(bool bEnable) return m_communication && m_communication->SetAckMask(0x1 << (uint8_t)m_iLogicalAddress); } -bool CCECProcessor::TransmitFormatted(const CCECAdapterMessage &data, bool bWaitForAck /* = true */) +bool CCECProcessor::Transmit(const cec_command &data, bool bWaitForAck /* = true */) { bool bReturn(false); + LogOutput(data); + + CCECAdapterMessage output(data); + CLockObject lock(&m_mutex); - if (!m_communication || !m_communication->Write(data)) + if (!m_communication || !m_communication->Write(output)) return bReturn; if (bWaitForAck) @@ -199,7 +195,7 @@ bool CCECProcessor::TransmitFormatted(const CCECAdapterMessage &data, bool bWait while (!bReturn && now < target && !bError) { - bReturn = WaitForAck(&bError, data.size(), (uint32_t) (target - now)); + bReturn = WaitForAck(&bError, output.size(), (uint32_t) (target - now)); now = GetTimeMs(); } diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index f635cd7..3d668ec 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -71,7 +71,6 @@ namespace CEC virtual void AddKey(void); virtual void AddLog(cec_log_level level, const CStdString &strMessage); - virtual bool TransmitFormatted(const CCECAdapterMessage &data, bool bWaitForAck = true); virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, ECecAbortReason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE); CCECBusDevice *m_busDevices[16];