bool CCECBusDevice::RequestMenuLanguage(void)
{
bool bReturn(false);
- if (!MyLogicalAddressContains(m_iLogicalAddress))
+ if (!MyLogicalAddressContains(m_iLogicalAddress) &&
+ !IsUnsupportedFeature(CEC_OPCODE_GET_MENU_LANGUAGE))
{
CStdString strLog;
strLog.Format("<< requesting menu language of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
bool CCECBusDevice::RequestOSDName(void)
{
bool bReturn(false);
- if (!MyLogicalAddressContains(m_iLogicalAddress))
+ if (!MyLogicalAddressContains(m_iLogicalAddress) &&
+ !IsUnsupportedFeature(CEC_OPCODE_GIVE_OSD_NAME))
{
CStdString strLog;
strLog.Format("<< requesting OSD name of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
bool CCECBusDevice::RequestPowerStatus(void)
{
bool bReturn(false);
- if (!MyLogicalAddressContains(m_iLogicalAddress))
+ if (!MyLogicalAddressContains(m_iLogicalAddress) &&
+ !IsUnsupportedFeature(CEC_OPCODE_GIVE_DEVICE_POWER_STATUS))
{
CStdString strLog;
strLog.Format("<< requesting power status of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
bool CCECBusDevice::TransmitOSDString(cec_logical_address dest, cec_display_control duration, const char *strMessage)
{
- CStdString strLog;
- strLog.Format("<< %s (%X) -> %s (%X): display OSD message '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest, strMessage);
- AddLog(CEC_LOG_NOTICE, strLog.c_str());
+ if (!IsUnsupportedFeature(CEC_OPCODE_SET_OSD_STRING))
+ {
+ CStdString strLog;
+ strLog.Format("<< %s (%X) -> %s (%X): display OSD message '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest, strMessage);
+ AddLog(CEC_LOG_NOTICE, strLog.c_str());
- return m_handler->TransmitOSDString(m_iLogicalAddress, dest, duration, strMessage);
+ return m_handler->TransmitOSDString(m_iLogicalAddress, dest, duration, strMessage);
+ }
+ return false;
}
bool CCECBusDevice::TransmitPhysicalAddress(void)
{
return m_handler->TransmitKeyRelease(m_processor->GetLogicalAddress(), m_iLogicalAddress, bWait);
}
+
+bool CCECBusDevice::IsUnsupportedFeature(cec_opcode opcode) const
+{
+ return m_unsupportedFeatures.find(opcode) != m_unsupportedFeatures.end();
+}
+
+void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode)
+{
+ m_unsupportedFeatures.insert(opcode);
+}
//@}
*/
#include <cectypes.h>
+#include <set>
#include "../platform/threads.h"
#include "../util/StdString.h"
virtual bool MyLogicalAddressContains(cec_logical_address address) const;
virtual cec_bus_device_status GetStatus(bool bForcePoll = false);
virtual bool IsActiveSource(void) const { return m_bActiveSource; }
-
+ virtual bool IsUnsupportedFeature(cec_opcode opcode) const;
+ virtual void SetUnsupportedFeature(cec_opcode opcode);
virtual void SetInactiveSource(void);
virtual void SetActiveSource(void);
uint64_t m_iLastActive;
cec_version m_cecVersion;
cec_bus_device_status m_deviceStatus;
+ std::set<cec_opcode> m_unsupportedFeatures;
CMutex m_writeMutex;
CMutex m_mutex;
};
case CEC_OPCODE_TEXT_VIEW_ON:
HandleTextViewOn(command);
break;
+ case CEC_OPCODE_FEATURE_ABORT:
+ HandleFeatureAbort(command);
+ break;
default:
UnhandledCommand(command);
bHandled = false;
return SetVendorId(command);
}
+bool CCECCommandHandler::HandleFeatureAbort(const cec_command &command)
+{
+ if (command.parameters.size == 2)
+ {
+ m_processor->m_busDevices[command.initiator]->SetUnsupportedFeature((cec_opcode)command.parameters[0]);
+ }
+}
+
bool CCECCommandHandler::HandleGetCecVersion(const cec_command &command)
{
if (m_processor->IsStarted() && m_busDevice->MyLogicalAddressContains(command.destination))