+ // some commands should never be marked as unsupported
+ if (opcode == CEC_OPCODE_VENDOR_COMMAND ||
+ opcode == CEC_OPCODE_VENDOR_COMMAND_WITH_ID ||
+ opcode == CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN ||
+ opcode == CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP ||
+ opcode == CEC_OPCODE_ABORT ||
+ opcode == CEC_OPCODE_FEATURE_ABORT ||
+ opcode == CEC_OPCODE_NONE)
+ return;
+
+ {
+ CLockObject lock(m_mutex);
+ if (m_unsupportedFeatures.find(opcode) == m_unsupportedFeatures.end())
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "marking opcode '%s' as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName());
+ m_unsupportedFeatures.insert(opcode);
+ }
+ }
+
+ // signal threads that are waiting for a reponse
+ MarkBusy();
+ m_handler->SignalOpcode(cec_command::GetResponseOpcode(opcode));
+ MarkReady();
+}
+
+bool CCECBusDevice::ActivateSource(void)
+{
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "activating source '%s'", ToString(m_iLogicalAddress));
+ MarkBusy();
+ bool bReturn = m_handler->ActivateSource();
+ MarkReady();
+ return bReturn;
+}
+
+void CCECBusDevice::HandlePoll(cec_logical_address destination)
+{
+ if (destination >= 0 && destination < CECDEVICE_BROADCAST)
+ {
+ CCECBusDevice *device = m_processor->m_busDevices[destination];
+ if (device)
+ device->HandlePollFrom(m_iLogicalAddress);
+ }
+}
+
+void CCECBusDevice::HandlePollFrom(cec_logical_address initiator)
+{
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "<< POLL: %s (%x) -> %s (%x)", ToString(initiator), initiator, ToString(m_iLogicalAddress), m_iLogicalAddress);
+ m_bAwaitingReceiveFailed = true;
+}
+
+bool CCECBusDevice::HandleReceiveFailed(void)
+{
+ bool bReturn = m_bAwaitingReceiveFailed;
+ m_bAwaitingReceiveFailed = false;
+ return bReturn;
+}
+
+void CCECBusDevice::CheckVendorIdRequested(void)
+{
+ bool bRequestVendorId(false);
+ {
+ CLockObject lock(m_mutex);
+ bRequestVendorId = !m_bVendorIdRequested;
+ m_bVendorIdRequested = true;
+ }
+
+ if (bRequestVendorId)
+ {
+ ReplaceHandler(false);
+ GetVendorId();
+ }