- /* enable SL */
- cec_command response;
- cec_command::Format(response, command.destination, command.initiator, CEC_OPCODE_VENDOR_COMMAND);
- response.PushBack(SL_COMMAND_UNKNOWN_02);
- response.PushBack(SL_COMMAND_UNKNOWN_03);
+ /* imitate LG devices */
+ if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
+ {
+ primary->SetVendorId(CEC_VENDOR_LG);
+ primary->ReplaceHandler(false);
+ }
+
+ if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
+ {
+ /* start as 'in transition standby->on' */
+ primary->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
+ primary->TransmitPowerState(CECDEVICE_TV, false);
+
+ /* send the vendor id */
+ primary->TransmitVendorID(CECDEVICE_BROADCAST, false, false);
+ }
+ }
+
+ return true;
+}
+
+int CSLCommandHandler::HandleActiveSource(const cec_command &command)
+{
+ if (command.parameters.size == 2)
+ {
+ uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
+ CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iAddress);
+ if (device)
+ device->MarkAsActiveSource();
+
+ {
+ CLockObject lock(m_SLMutex);
+ m_bActiveSourceSent = false;
+ }
+
+ return COMMAND_HANDLED;
+ }