{
Close();
delete m_cec;
- m_cec = NULL;
-
delete m_comm;
- m_comm = NULL;
-
- m_logBuffer.Clear();
- m_keyBuffer.Clear();
- m_commandBuffer.Clear();
}
bool CLibCEC::Open(const char *strPort, uint32_t iTimeoutMs /* = 10000 */)
return m_comm ? m_comm->StartBootloader() : false;
}
-int8_t CLibCEC::GetMinVersion(void)
-{
- return CEC_MIN_VERSION;
-}
-
-int8_t CLibCEC::GetLibVersion(void)
-{
- return CEC_LIB_VERSION;
-}
-
bool CLibCEC::GetNextLogMessage(cec_log_message *message)
{
return (m_logBuffer.Pop(*message));
return CEC_VERSION_UNKNOWN;
}
+bool CLibCEC::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language)
+{
+ if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
+ return m_cec->GetDeviceMenuLanguage(iAddress, language);
+ return false;
+}
+
+uint64_t CLibCEC::GetDeviceVendorId(cec_logical_address iAddress)
+{
+ if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
+ return m_cec->GetDeviceVendorId(iAddress);
+ return 0;
+}
+
+cec_power_status CLibCEC::GetDevicePowerStatus(cec_logical_address iAddress)
+{
+ if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
+ return m_cec->GetDevicePowerStatus(iAddress);
+ return CEC_POWER_STATUS_UNKNOWN;
+}
+
void CLibCEC::AddLog(cec_log_level level, const string &strMessage)
{
if (m_cec)
}
}
+void CLibCEC::AddKey(cec_keypress &key)
+{
+ m_keyBuffer.Push(key);
+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN;
+ m_buttontime = 0;
+}
+
void CLibCEC::AddKey(void)
{
if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN)
key.keycode = m_iCurrentButton;
m_keyBuffer.Push(key);
m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN;
- m_buttontime = 0;
}
+ m_buttontime = 0;
}
void CLibCEC::AddCommand(const cec_command &command)