From: Lars Op den Kamp Date: Sun, 30 Oct 2011 12:31:39 +0000 (+0100) Subject: cec: store all commands in the command buffer, so they can be processed by libcec... X-Git-Tag: upstream/2.2.0~1^2~170 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b5b53c7d324f4444875befe6bf75b5c4dcac743c;p=deb_libcec.git cec: store all commands in the command buffer, so they can be processed by libcec clients --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index f321a70..0607acd 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -93,6 +93,8 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) bHandled = false; break; } + + m_busDevice->GetProcessor()->AddCommand(command); } else if (command.destination == CECDEVICE_BROADCAST) { @@ -122,6 +124,8 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) bHandled = false; break; } + + m_busDevice->GetProcessor()->AddCommand(command); } else { @@ -318,7 +322,9 @@ bool CCECCommandHandler::HandleUserControlRelease(const cec_command &command) void CCECCommandHandler::UnhandledCommand(const cec_command &command) { - m_busDevice->GetProcessor()->AddCommand(command); + CStdString strLog; + strLog.Format("unhandled command with opcode %02x from address %d", command.opcode, command.initiator); + m_busDevice->AddLog(CEC_LOG_DEBUG, strLog); } CCECBusDevice *CCECCommandHandler::GetDevice(cec_logical_address iLogicalAddress) const diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 3117ee6..9952a8c 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -391,6 +391,10 @@ int main (int argc, char *argv[]) { flush_log(parser); + /* just ignore the command buffer and clear it */ + cec_command dummy; + while (parser && parser->GetNextCommand(&dummy)) {} + string input; getline(cin, input); cin.clear();