return CEC_DEVICE_TYPE_RESERVED;
}
}
+
+uint16_t CLibCEC::GetMaskForType(cec_logical_address address)
+{
+ return GetMaskForType(GetType(address));
+}
+
+uint16_t CLibCEC::GetMaskForType(cec_device_type type)
+{
+ switch (type)
+ {
+ case CEC_DEVICE_TYPE_AUDIO_SYSTEM:
+ {
+ cec_logical_addresses addr;
+ addr.Clear();
+ addr.Set(CECDEVICE_AUDIOSYSTEM);
+ return addr.AckMask();
+ }
+ case CEC_DEVICE_TYPE_PLAYBACK_DEVICE:
+ {
+ cec_logical_addresses addr;
+ addr.Clear();
+ addr.Set(CECDEVICE_PLAYBACKDEVICE1);
+ addr.Set(CECDEVICE_PLAYBACKDEVICE2);
+ addr.Set(CECDEVICE_PLAYBACKDEVICE3);
+ return addr.AckMask();
+ }
+ case CEC_DEVICE_TYPE_RECORDING_DEVICE:
+ {
+ cec_logical_addresses addr;
+ addr.Clear();
+ addr.Set(CECDEVICE_RECORDINGDEVICE1);
+ addr.Set(CECDEVICE_RECORDINGDEVICE2);
+ addr.Set(CECDEVICE_RECORDINGDEVICE3);
+ return addr.AckMask();
+ }
+ case CEC_DEVICE_TYPE_TUNER:
+ {
+ cec_logical_addresses addr;
+ addr.Clear();
+ addr.Set(CECDEVICE_TUNER1);
+ addr.Set(CECDEVICE_TUNER2);
+ addr.Set(CECDEVICE_TUNER3);
+ addr.Set(CECDEVICE_TUNER4);
+ return addr.AckMask();
+ }
+ case CEC_DEVICE_TYPE_TV:
+ {
+ cec_logical_addresses addr;
+ addr.Clear();
+ addr.Set(CECDEVICE_TV);
+ return addr.AckMask();
+ }
+ default:
+ return 0;
+ }
+}
const char *ToString(const cec_server_version version);
static cec_device_type GetType(cec_logical_address address);
+ static uint16_t GetMaskForType(cec_logical_address address);
+ static uint16_t GetMaskForType(cec_device_type type);
//@}
static void AddLog(const cec_log_level level, const char *strFormat, ...);
bReturn &= SetAutoEnabled(true);
bReturn &= SetDeviceType(CLibCEC::GetType(configuration->logicalAddresses.primary));
bReturn &= SetDefaultLogicalAddress(configuration->logicalAddresses.primary);
- bReturn &= SetLogicalAddressMask(configuration->logicalAddresses.AckMask());
+ bReturn &= SetLogicalAddressMask(CLibCEC::GetMaskForType(configuration->logicalAddresses.primary));
bReturn &= SetPhysicalAddress(configuration->iPhysicalAddress);
bReturn &= SetCECVersion(CEC_VERSION_1_3A);
bReturn &= SetOSDName(configuration->strDeviceName);