CRPiCECAdapterCommunication::CRPiCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
IAdapterCommunication(callback),
m_logicalAddress(CECDEVICE_UNKNOWN),
- m_bLogicalAddressChanged(false)
+ m_bLogicalAddressChanged(false),
+ m_previousLogicalAddress(CECDEVICE_FREEUSE)
{
m_queue = new CRPiCECAdapterMessageQueue(this);
}
case VC_CEC_LOGICAL_ADDR:
{
CLockObject lock(m_mutex);
+ m_previousLogicalAddress = m_logicalAddress;
if (CEC_CB_RC(header) == VCHIQ_SUCCESS)
{
m_bLogicalAddressChanged = true;
}
else
{
- m_logicalAddress = CECDEVICE_BROADCAST;
+ m_logicalAddress = CECDEVICE_FREEUSE;
LIB_CEC->AddLog(CEC_LOG_DEBUG, "failed to change the logical address, reset to %s (%x)", LIB_CEC->ToString(m_logicalAddress), m_logicalAddress);
}
m_logicalAddressCondition.Signal();
case VC_CEC_LOGICAL_ADDR_LOST:
{
// the logical address was taken by another device
- cec_logical_address previousAddress = m_logicalAddress;
+ cec_logical_address previousAddress = m_logicalAddress == CECDEVICE_BROADCAST ? m_previousLogicalAddress : m_logicalAddress;
m_logicalAddress = CECDEVICE_UNKNOWN;
// notify libCEC that we lost our LA when the connection was initialised
* http://www.pulse-eight.net/
*/
+#include "env.h"
#if defined(HAVE_RPI_API)
#include "lib/adapter/AdapterCommunication.h"
PLATFORM::CMutex m_mutex;
VCHI_INSTANCE_T m_vchi_instance;
VCHI_CONNECTION_T * m_vchi_connection;
+ cec_logical_address m_previousLogicalAddress;
};
};