From b5b53c7d324f4444875befe6bf75b5c4dcac743c Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 30 Oct 2011 13:31:39 +0100 Subject: [PATCH] cec: store all commands in the command buffer, so they can be processed by libcec clients --- src/lib/implementations/CECCommandHandler.cpp | 8 +++++++- src/testclient/main.cpp | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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(); -- 2.34.1