+ MarkBusy();
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< requesting power status of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
+ bReturn = m_handler->TransmitRequestPowerStatus(initiator, m_iLogicalAddress, bWaitForResponse);
+ MarkReady();
+ }
+ return bReturn;
+}
+
+bool CCECBusDevice::TransmitPowerState(const cec_logical_address destination, bool bIsReply)
+{
+ cec_power_status state;
+ {
+ CLockObject lock(m_mutex);
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): %s", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination, ToString(m_powerStatus));
+ state = m_powerStatus;
+ }
+
+ MarkBusy();
+ bool bReturn = m_handler->TransmitPowerState(m_iLogicalAddress, destination, state, bIsReply);
+ MarkReady();
+ return bReturn;
+}
+
+cec_vendor_id CCECBusDevice::GetCurrentVendorId(void)
+{
+ CLockObject lock(m_mutex);
+ return m_vendor;
+}
+
+cec_vendor_id CCECBusDevice::GetVendorId(const cec_logical_address initiator, bool bUpdate /* = false */)
+{
+ bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT);
+ bool bRequestUpdate(false);
+ {
+ CLockObject lock(m_mutex);
+ bRequestUpdate = (bIsPresent &&
+ (bUpdate || m_vendor == CEC_VENDOR_UNKNOWN));
+ }
+
+ if (bRequestUpdate)
+ RequestVendorId(initiator);
+
+ CLockObject lock(m_mutex);
+ return m_vendor;
+}
+
+const char *CCECBusDevice::GetVendorName(const cec_logical_address initiator, bool bUpdate /* = false */)
+{
+ return ToString(GetVendorId(initiator, bUpdate));
+}
+
+bool CCECBusDevice::SetVendorId(uint64_t iVendorId)
+{
+ bool bVendorChanged(false);
+
+ {
+ CLockObject lock(m_mutex);
+ bVendorChanged = (m_vendor != (cec_vendor_id)iVendorId);
+ m_vendor = (cec_vendor_id)iVendorId;
+ }
+
+ if (bVendorChanged)
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): vendor = %s (%06x)", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_vendor), m_vendor);
+
+ return bVendorChanged;
+}
+
+bool CCECBusDevice::RequestVendorId(const cec_logical_address initiator, bool bWaitForResponse /* = true */)
+{
+ bool bReturn(false);
+
+ if (!IsHandledByLibCEC() && initiator != CECDEVICE_UNKNOWN)
+ {
+ MarkBusy();
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< requesting vendor ID of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
+ bReturn = m_handler->TransmitRequestVendorId(initiator, m_iLogicalAddress, bWaitForResponse);
+ MarkReady();
+
+ if (bWaitForResponse)
+ ReplaceHandler(true);
+ }
+ return bReturn;
+}
+
+bool CCECBusDevice::TransmitVendorID(const cec_logical_address destination, bool bSendAbort, bool bIsReply)
+{
+ bool bReturn(false);
+ uint64_t iVendorId;
+ {
+ CLockObject lock(m_mutex);
+ iVendorId = (uint64_t)m_vendor;
+ }
+
+ MarkBusy();
+ if (iVendorId == CEC_VENDOR_UNKNOWN)
+ {
+ if (bSendAbort)