SetAckMask(m_logicalAddresses.AckMask());
+ ScanCECBus();
+
{
CLockObject lock(&m_mutex);
m_bStarted = true;
return bReturn;
}
+void CCECProcessor::ScanCECBus(void)
+{
+ CCECBusDevice *device(NULL);
+ for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
+ {
+ device = m_busDevices[iPtr];
+ if (device && device->GetStatus() == CEC_DEVICE_STATUS_PRESENT)
+ {
+ device->GetPhysicalAddress();
+ device->GetCecVersion();
+ device->GetVendorId();
+ }
+ }
+}
+
bool CCECProcessor::CheckPhysicalAddress(uint16_t iPhysicalAddress)
{
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
bool CCECProcessor::PollDevice(cec_logical_address iAddress)
{
if (iAddress != CECDEVICE_UNKNOWN && m_busDevices[iAddress])
- return m_busDevices[m_logicalAddresses.primary]->TransmitPoll(iAddress);
+ {
+ return m_logicalAddresses.primary == CECDEVICE_UNKNOWN ?
+ m_busDevices[iAddress]->TransmitPoll(iAddress) :
+ m_busDevices[m_logicalAddresses.primary]->TransmitPoll(iAddress);
+ }
return false;
}
return m_busDevices[iAddress]->GetCecVersion();
}
+cec_osd_name CCECProcessor::GetDeviceOSDName(cec_logical_address iAddress)
+{
+ CStdString strOSDName = m_busDevices[iAddress]->GetOSDName();
+ cec_osd_name retVal;
+
+ snprintf(retVal.name, sizeof(retVal.name), "%s", strOSDName.c_str());
+ retVal.device = iAddress;
+
+ return retVal;
+}
+
bool CCECProcessor::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language)
{
if (m_busDevices[iAddress])
return bReturn;
}
+
+bool CCECProcessor::SendKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait /* = false */)
+{
+ return m_busDevices[iDestination]->SendKeypress(key, bWait);
+}
+
+bool CCECProcessor::SendKeyRelease(cec_logical_address iDestination, bool bWait /* = false */)
+{
+ return m_busDevices[iDestination]->SendKeyRelease(bWait);
+}