cec: parse and store the vendor id and device class of devices. only the vendor ID...
[deb_libcec.git] / src / lib / LibCEC.cpp
index 0f88470554dec9957713e9d4e6d318e10634af5f..9498bc9995810d4f1e7c31c22e0dab7e2e2e1e6d 100644 (file)
@@ -42,6 +42,7 @@ using namespace std;
 using namespace CEC;
 
 CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) :
+    m_iStartTime(GetTimeMs()),
     m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN),
     m_buttontime(0)
 {
@@ -183,6 +184,7 @@ void CLibCEC::AddLog(cec_log_level level, const string &strMessage)
   {
     cec_log_message message;
     message.level = level;
+    message.time = GetTimeMs() - m_iStartTime;
     snprintf(message.message, sizeof(message.message), "%s", strMessage.c_str());
     m_logBuffer.Push(message);
   }
@@ -215,7 +217,7 @@ void CLibCEC::AddCommand(cec_logical_address source, cec_logical_address destina
   if (m_commandBuffer.Push(command))
   {
     CStdString strDebug;
-    strDebug.Format("stored command '%d' in the command buffer. buffer size = %d", opcode, m_commandBuffer.Size());
+    strDebug.Format("stored command '%2x' in the command buffer. buffer size = %d", opcode, m_commandBuffer.Size());
     AddLog(CEC_LOG_DEBUG, strDebug);
   }
   else