+ CLockObject lock(&m_writeMutex);
+ if (m_vendor == CEC_VENDOR_UNKNOWN)
+ {
+ CStdString strLog;
+ strLog.Format("<< %s (%X) -> %s (%X): vendor id feature abort", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest);
+ AddLog(CEC_LOG_NOTICE, strLog);
+
+ lock.Leave();
+ m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+ return false;
+ }
+ else
+ {
+ CStdString strLog;
+ strLog.Format("<< %s (%X) -> %s (%X): vendor id %s (%x)", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest, ToString(m_vendor), (uint64_t)m_vendor);
+ AddLog(CEC_LOG_NOTICE, strLog);
+
+ cec_command command;
+ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_DEVICE_VENDOR_ID);
+
+ command.parameters.PushBack((uint8_t) (((uint64_t)m_vendor >> 16) & 0xFF));
+ command.parameters.PushBack((uint8_t) (((uint64_t)m_vendor >> 8) & 0xFF));
+ command.parameters.PushBack((uint8_t) ((uint64_t)m_vendor & 0xFF));
+
+ lock.Leave();
+ return m_processor->Transmit(command);
+ }
+}
+
+bool CCECBusDevice::SendKeypress(cec_user_control_code key, bool bWait /* = false */)
+{
+ CLockObject lock(&m_transmitMutex);
+ cec_command command;
+ cec_command::Format(command, m_processor->GetLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_USER_CONTROL_PRESSED);
+ command.parameters.PushBack((uint8_t)key);
+
+ if (bWait)
+ {
+ if (m_processor->Transmit(command))
+ return m_condition.Wait(&m_transmitMutex, 1000);
+ return false;
+ }
+
+ return m_processor->Transmit(command);
+}
+
+bool CCECBusDevice::SendKeyRelease(bool bWait /* = false */)
+{
+ CLockObject lock(&m_transmitMutex);
+ cec_command command;
+ cec_command::Format(command, m_processor->GetLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_USER_CONTROL_RELEASE);
+
+ if (bWait)
+ {
+ if (m_processor->Transmit(command))
+ return m_condition.Wait(&m_transmitMutex, 1000);
+ return false;
+ }
+ else
+ {
+ return m_processor->Transmit(command);
+ }