- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && GetTimeMs() - m_buttontime > CEC_BUTTON_TIMEOUT)
- {
- AddKey();
- m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN;
- }
+ // check all clients
+ for (vector<CCECClient *>::iterator it = m_clients.begin(); it != m_clients.end(); it++)
+ (*it)->CheckKeypressTimeout();
+}
+
+void CLibCEC::AddLog(const cec_log_level level, const char *strFormat, ...)
+{
+ CStdString strLog;
+
+ // format the message
+ va_list argList;
+ va_start(argList, strFormat);
+ strLog.FormatV(strFormat, argList);
+ va_end(argList);
+
+ cec_log_message message;
+ message.level = level;
+ message.time = GetTimeMs() - m_iStartTime;
+ snprintf(message.message, sizeof(message.message), "%s", strLog.c_str());
+
+ // send the message to all clients
+ for (vector<CCECClient *>::iterator it = m_clients.begin(); it != m_clients.end(); it++)
+ (*it)->AddLog(message);