From 9169d73e308be40605d5e2902a0ea1542a1d797e Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Mon, 18 Mar 2013 16:06:18 +0100 Subject: [PATCH] added CCECCommandHandler::RequestEmailFromCustomer --- src/lib/implementations/CECCommandHandler.cpp | 28 +++++++++++++++++++ src/lib/implementations/CECCommandHandler.h | 3 ++ 2 files changed, 31 insertions(+) diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 28cee42..b961878 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -1265,3 +1265,31 @@ void CCECCommandHandler::ScheduleActivateSource(uint64_t iDelay) CLockObject lock(m_mutex); m_iActiveSourcePending = GetTimeMs() + iDelay; } + +void CCECCommandHandler::RequestEmailFromCustomer(const cec_command& command) +{ + bool bInserted(false); + map >::iterator it = m_logsRequested.find(command.opcode); + if (it != m_logsRequested.end()) + { + for (vector::const_iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) + { + // we already logged this one + if ((*it2).parameters == command.parameters) + return; + } + + it->second.push_back(command); + bInserted = true; + } + + if (!bInserted) + { + vector commands; + commands.push_back(command); + 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()); +} + diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index e265038..9902a08 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -33,6 +33,7 @@ #include #include +#include #include "lib/platform/threads/mutex.h" namespace CEC @@ -139,6 +140,7 @@ namespace CEC virtual int HandleVendorRemoteButtonDown(const cec_command& command); virtual int HandleVendorRemoteButtonUp(const cec_command & UNUSED(command)) { return COMMAND_HANDLED; } virtual void UnhandledCommand(const cec_command &command, const cec_abort_reason reason); + virtual void RequestEmailFromCustomer(const cec_command& command); virtual void VendorPreActivateSourceHook(void) {}; @@ -164,5 +166,6 @@ namespace CEC int64_t m_iActiveSourcePending; PLATFORM::CMutex m_mutex; int64_t m_iPowerStatusRequested; + std::map > m_logsRequested; }; }; -- 2.34.1