/*
* 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.
bool bHandled(true);
MarkBusy();
- CLibCEC::AddLog(CEC_LOG_NOTICE, ">> %s (%X) -> %s (%X): %s (%2X)", m_processor->ToString(command.initiator), command.initiator, m_processor->ToString(command.destination), command.destination, m_processor->ToString(command.opcode), command.opcode);
-
- m_processor->AddCommand(command);
+ CLibCEC::AddCommand(command);
switch(command.opcode)
{
{
device->SetActiveSource();
device->TransmitActiveSource();
+
+ device->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+ device->TransmitMenuState(command.initiator);
}
}
return false;
{
if (m_processor->IsStarted() && m_busDevice->MyLogicalAddressContains(command.destination) && command.parameters.size > 0)
{
- m_processor->AddKey();
+ CLibCEC::AddKey();
if (command.parameters[0] <= CEC_USER_CONTROL_CODE_MAX)
{
- CLibCEC::AddLog(CEC_LOG_DEBUG, "key pressed: %x", command.parameters[0]);
-
if (command.parameters[0] == CEC_USER_CONTROL_CODE_POWER ||
command.parameters[0] == CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION)
{
}
else
{
- m_processor->SetCurrentButton((cec_user_control_code) command.parameters[0]);
+ CLibCEC::SetCurrentButton((cec_user_control_code) command.parameters[0]);
}
return true;
}
bool CCECCommandHandler::HandleUserControlRelease(const cec_command &command)
{
if (m_processor->IsStarted() && m_busDevice->MyLogicalAddressContains(command.destination))
- m_processor->AddKey();
+ CLibCEC::AddKey();
return true;
}
while (!bReturn && ++iTries <= iMaxTries)
{
m_expectedResponse = expectedResponse;
- if (m_processor->Transmit(command))
+ if ((bReturn = m_processor->Transmit(command)) == true)
{
CLibCEC::AddLog(CEC_LOG_DEBUG, "command transmitted");
- bReturn = bExpectResponse ?
- m_condition.Wait(m_receiveMutex, m_iTransmitWait) :
- true;
+ if (bExpectResponse)
+ bReturn = m_condition.Wait(m_receiveMutex, m_iTransmitWait);
}
}
--m_iUseCounter;