本文整理汇总了C++中CCECBusDevice::IsUnsupportedFeature方法的典型用法代码示例。如果您正苦于以下问题:C++ CCECBusDevice::IsUnsupportedFeature方法的具体用法?C++ CCECBusDevice::IsUnsupportedFeature怎么用?C++ CCECBusDevice::IsUnsupportedFeature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCECBusDevice
的用法示例。
在下文中一共展示了CCECBusDevice::IsUnsupportedFeature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Transmit
bool CCECProcessor::Transmit(const cec_command &data, bool bIsReply)
{
cec_command transmitData(data);
uint8_t iMaxTries(0);
bool bRetry(true);
uint8_t iTries(0);
// get the current timeout setting
uint8_t iLineTimeout(GetStandardLineTimeout());
// reset the state of this message to 'unknown'
cec_adapter_message_state adapterState = ADAPTER_MESSAGE_STATE_UNKNOWN;
CLockObject lock(m_mutex);
if (!m_communication)
return false;
if (!m_communication->SupportsSourceLogicalAddress(transmitData.initiator))
{
if (transmitData.initiator == CECDEVICE_UNREGISTERED && m_communication->SupportsSourceLogicalAddress(CECDEVICE_FREEUSE))
{
m_libcec->AddLog(CEC_LOG_DEBUG, "initiator '%s' is not supported by the CEC adapter. using '%s' instead", ToString(transmitData.initiator), ToString(CECDEVICE_FREEUSE));
transmitData.initiator = CECDEVICE_FREEUSE;
}
else
{
m_libcec->AddLog(CEC_LOG_DEBUG, "initiator '%s' is not supported by the CEC adapter", ToString(transmitData.initiator));
return false;
}
}
LogOutput(transmitData);
// find the initiator device
CCECBusDevice *initiator = m_busDevices->At(transmitData.initiator);
if (!initiator)
{
m_libcec->AddLog(CEC_LOG_WARNING, "invalid initiator");
return false;
}
// find the destination device, if it's not the broadcast address
if (transmitData.destination != CECDEVICE_BROADCAST)
{
// check if the device is marked as handled by libCEC
CCECBusDevice *destination = m_busDevices->At(transmitData.destination);
if (destination && destination->IsHandledByLibCEC())
{
// and reject the command if it's trying to send data to a device that is handled by libCEC
m_libcec->AddLog(CEC_LOG_WARNING, "not sending data to myself!");
return false;
}
}
// wait until we finished allocating a new LA if it got lost
lock.Unlock();
while (m_bStallCommunication) Sleep(5);
lock.Lock();
m_iLastTransmission = GetTimeMs();
// set the number of tries
iMaxTries = initiator->GetHandler()->GetTransmitRetries() + 1;
initiator->MarkHandlerReady();
// and try to send the command
while (bRetry && ++iTries < iMaxTries)
{
if (initiator->IsUnsupportedFeature(transmitData.opcode))
return false;
adapterState = !IsStopped() && m_communication && m_communication->IsOpen() ?
m_communication->Write(transmitData, bRetry, iLineTimeout, bIsReply) :
ADAPTER_MESSAGE_STATE_ERROR;
iLineTimeout = m_iRetryLineTimeout;
}
return bIsReply ?
adapterState == ADAPTER_MESSAGE_STATE_SENT_ACKED || adapterState == ADAPTER_MESSAGE_STATE_SENT || adapterState == ADAPTER_MESSAGE_STATE_WAITING_TO_BE_SENT :
adapterState == ADAPTER_MESSAGE_STATE_SENT_ACKED;
}