bool CCECBusDevice::TransmitActiveSource(void)
{
CStdString strLog;
- strLog.Format("<< %x -> broadcast: active source", m_iLogicalAddress);
+ strLog.Format("<< %x -> broadcast: active source (%4x)", m_iLogicalAddress, m_iPhysicalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
bool CCECBusDevice::TransmitActiveView(void)
{
CStdString strLog;
- strLog.Format("<< %x -> broadcast: active view", m_iLogicalAddress);
+ strLog.Format("<< %x -> broadcast: active view (%4x)", m_iLogicalAddress, m_iPhysicalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
CStdString strLog;
strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- if (streamaddr == m_busDevice->GetMyPhysicalAddress())
- {
- CCECBusDevice *device = GetDevice(command.destination);
- if (device)
- return device->TransmitActiveSource();
- return false;
- }
+ CCECBusDevice *device = GetDeviceByPhysicalAddress(streamaddr);
+ if (device)
+ return device->TransmitActiveSource();
}
return true;
}
return device;
}
+
+CCECBusDevice *CCECCommandHandler::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress) const
+{
+ CCECBusDevice *device = NULL;
+
+ for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
+ {
+ if (m_busDevice->GetProcessor()->m_busDevices[iPtr]->GetPhysicalAddress() == iPhysicalAddress)
+ {
+ device = m_busDevice->GetProcessor()->m_busDevices[iPtr];
+ break;
+ }
+ }
+
+ return device;
+}
virtual void UnhandledCommand(const cec_command &command);
virtual CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
+ virtual CCECBusDevice *GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress) const;
CCECBusDevice *m_busDevice;
};
};