- // need to support opcodes play and deck control before doing anything with this
- AddLog(CEC_LOG_NOTICE, "<< deck status requested, feature abort");
- m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+ CLockObject lock(&m_writeMutex);
+ if (m_powerStatus != CEC_POWER_STATUS_ON)
+ {
+ CStdString strLog;
+ strLog.Format("<< %s (%X) is not powered on", GetLogicalAddressName(), m_iLogicalAddress);
+ AddLog(CEC_LOG_DEBUG, strLog);
+ }
+ else if (m_bActiveSource)
+ {
+ CStdString strLog;
+ strLog.Format("<< %s (%X) -> broadcast (F): active source (%4x)", GetLogicalAddressName(), m_iLogicalAddress, m_iPhysicalAddress);
+ AddLog(CEC_LOG_NOTICE, strLog);
+
+ cec_command command;
+ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
+ command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF));
+ command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF));
+
+ lock.Leave();
+ return m_processor->Transmit(command);
+ }
+ else
+ {
+ CStdString strLog;
+ strLog.Format("<< %s (%X) is not the active source", GetLogicalAddressName(), m_iLogicalAddress);
+ AddLog(CEC_LOG_DEBUG, strLog);
+ }
+