int CCECCommandHandler::HandleDeviceVendorId(const cec_command &command)
{
SetVendorId(command);
+
+ if (command.initiator == CECDEVICE_TV)
+ {
+ CCECBusDevice* primary = m_processor->GetPrimaryDevice();
+ if (primary)
+ primary->TransmitVendorID(CECDEVICE_BROADCAST, false, false);
+ }
+
return COMMAND_HANDLED;
}
{
uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
SetPhysicalAddress(command.initiator, iNewAddress);
+
+ if (command.initiator == CECDEVICE_TV)
+ {
+ CCECBusDevice* primary = m_processor->GetPrimaryDevice();
+ if (primary)
+ primary->TransmitPhysicalAddress(false);
+ }
return COMMAND_HANDLED;
}
return CEC_ABORT_REASON_INVALID_OPERAND;
CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress);
if (device)
{
- if (device->IsHandledByLibCEC() && !device->IsActiveSource())
- device->ActivateSource();
- else
- device->MarkAsActiveSource();
+ if (device->IsHandledByLibCEC())
+ {
+ if (!device->IsActiveSource())
+ device->ActivateSource();
+ else
+ {
+ device->MarkAsActiveSource();
+ device->TransmitActiveSource(true);
+ }
+ }
return COMMAND_HANDLED;
}
- else
- {
- cec_logical_address previousSource = m_processor->GetActiveSource(false);
- CCECBusDevice* device = m_processor->GetDevice(previousSource);
- if (device && device->GetCurrentPhysicalAddress() != iStreamAddress)
- device->MarkAsInactiveSource();
- }
}
return CEC_ABORT_REASON_INVALID_OPERAND;
{
LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending abort with opcode %02x and reason '%s' to %s", command.opcode, ToString(reason), ToString(command.initiator));
m_processor->TransmitAbort(command.destination, command.initiator, command.opcode, reason);
+
+ if (reason == CEC_ABORT_REASON_INVALID_OPERAND)
+ RequestEmailFromCustomer(command);
}
}
return Transmit(command, !bWaitForResponse, false);
}
-bool CCECCommandHandler::TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
+bool CCECCommandHandler::TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bUpdate, bool bWaitForResponse /* = true */)
{
if (iDestination == CECDEVICE_TV)
{
int64_t now(GetTimeMs());
- if (now - m_iPowerStatusRequested < REQUEST_POWER_STATUS_TIMEOUT)
+ if (!bUpdate && now - m_iPowerStatusRequested < REQUEST_POWER_STATUS_TIMEOUT)
return true;
m_iPowerStatusRequested = now;
}
bool bTvPresent = (tv && tv->GetStatus() == CEC_DEVICE_STATUS_PRESENT);
bool bActiveSourceFailed(false);
if (bTvPresent)
- bActiveSourceFailed = !m_busDevice->TransmitImageViewOn();
+ bActiveSourceFailed = !tv->PowerOn(m_busDevice->GetLogicalAddress());
else
LIB_CEC->AddLog(CEC_LOG_DEBUG, "TV not present, not sending 'image view on'");
if (playbackDevice && SendDeckStatusUpdateOnActiveSource())
bActiveSourceFailed = !playbackDevice->TransmitDeckStatus(CECDEVICE_TV, false);
}
+
+ // update system audio mode for audiosystem devices
+ if (bTvPresent && !bActiveSourceFailed)
+ {
+ CCECAudioSystem* audioDevice = m_busDevice->AsAudioSystem();
+ if (audioDevice)
+ bActiveSourceFailed = !audioDevice->TransmitSetSystemAudioMode(CECDEVICE_TV, false);
+ }
}
// retry later
m_logsRequested.insert(make_pair(command.opcode, commands));
}
- LIB_CEC->AddLog(CEC_LOG_NOTICE, "key with keycode '%s' is not mapped in libCEC. please send an email to support@pulse-eight.com with this keycode, and tell which key you pressed, and we'll add support for this key.", CCECTypeUtils::ToString(command).c_str());
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "Unmapped code detected. Please send an email to support@pulse-eight.com with the following details, and if you pressed a key, tell us which one you pressed, and we'll add support for this it.\nCEC command: %s\nVendor ID: %s (%06x)", ToString(command).c_str(), ToString(m_vendorId), m_vendorId);
}