/*
* This file is part of the libCEC(R) library.
*
- * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
#include "../devices/CECBusDevice.h"
#include "../devices/CECPlaybackDevice.h"
#include "../CECProcessor.h"
-#include "../platform/timeutils.h"
-#include "../platform/threads.h"
using namespace CEC;
CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) :
CCECCommandHandler(busDevice),
- m_bAwaitingReceiveFailed(false),
m_bSLEnabled(false),
m_bPowerStateReset(false)
{
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
/* imitate LG devices */
- if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
+ if (primary && m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
primary->SetVendorId(CEC_VENDOR_LG);
SetLGDeckStatus();
m_busDevice->SetMenuLanguage(lang);
}
-
-void CSLCommandHandler::HandlePoll(const cec_logical_address iInitiator, const cec_logical_address iDestination)
-{
- CCECCommandHandler::HandlePoll(iInitiator, iDestination);
- m_bAwaitingReceiveFailed = true;
-}
-
-bool CSLCommandHandler::HandleReceiveFailed(void)
-{
- if (m_bAwaitingReceiveFailed)
- {
- m_bAwaitingReceiveFailed = false;
- return false;
- }
-
- return true;
-}
-
bool CSLCommandHandler::InitHandler(void)
{
if (m_bHandlerInited)
if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
primary->TransmitVendorID(CECDEVICE_TV, false);
- primary->SetPowerStatus(CEC_POWER_STATUS_STANDBY);
+ primary->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
return true;
}
return true;
}
+bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command)
+{
+ SetVendorId(command);
+
+ cec_command response;
+ cec_command::Format(response, m_processor->GetLogicalAddress(), command.initiator, CEC_OPCODE_FEATURE_ABORT);
+ return Transmit(response);
+}
+
bool CSLCommandHandler::HandleFeatureAbort(const cec_command &command)
{
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
if (primary->GetPowerStatus(false) == CEC_POWER_STATUS_ON && !m_bPowerStateReset && !m_bSLEnabled)
{
m_bPowerStateReset = true;
- primary->SetPowerStatus(CEC_POWER_STATUS_STANDBY);
+ primary->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
}
return CCECCommandHandler::HandleFeatureAbort(command);
bool CSLCommandHandler::HandleGivePhysicalAddress(const cec_command &command)
{
- if (m_processor->IsStarted() && m_busDevice->MyLogicalAddressContains(command.destination))
+ if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination))
{
CCECBusDevice *device = GetDevice(command.destination);
if (device)
cec_command response;
cec_command::Format(response, iSource, iDestination, CEC_OPCODE_VENDOR_COMMAND);
response.PushBack(SL_COMMAND_CONNECT_ACCEPT);
- response.PushBack((uint8_t)iSource);
+ response.PushBack((uint8_t)m_processor->m_busDevices[iSource]->GetType());
Transmit(response, false);
}