return device;
}
+CCECBusDevice *CCECProcessor::GetPrimaryDevice(void) const
+{
+ CCECBusDevice *device(NULL);
+ cec_logical_address primary = m_logicalAddresses.primary;
+ if (primary != CECDEVICE_UNKNOWN)
+ device = m_busDevices[primary];
+ return device;
+}
+
cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress)
{
return m_busDevices[iAddress]->GetCecVersion();
virtual bool IsMonitoring(void) const { return m_bMonitor; }
virtual CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh = false) const;
virtual CCECBusDevice * GetDeviceByType(cec_device_type type) const;
+ virtual CCECBusDevice * GetPrimaryDevice(void) const;
virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress);
virtual bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
virtual const std::string & GetDeviceName(void) { return m_strDeviceName; }
{
if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
{
- CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+ CCECBusDevice *primary = m_processor->GetPrimaryDevice();
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
m_bVendorIdSent(false)
{
/* TODO set to powered off until we fixed the connect on start loop issue */
- m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary]->m_powerStatus = CEC_POWER_STATUS_STANDBY;
+ m_processor->GetPrimaryDevice()->m_powerStatus = CEC_POWER_STATUS_STANDBY;
}
bool CSLCommandHandler::HandleVendorCommand(const cec_command &command)
void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
{
- CCECBusDevice *device = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+ CCECBusDevice *device = m_processor->GetPrimaryDevice();
if (device)
{
m_bSLEnabled = true;
void CSLCommandHandler::TransmitDeckStatus(const cec_logical_address iDestination)
{
/* set deck status for the playback device */
- CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+ CCECBusDevice *primary = m_processor->GetPrimaryDevice();
if (primary->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
{
((CCECPlaybackDevice *)primary)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
m_iTransmitRetries = 4;
m_iTransmitTimeout = 500;
- CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+ CCECBusDevice *primary = m_processor->GetPrimaryDevice();
if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
{
primary->SetVendorId(CEC_VENDOR_LG, false);