X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=f03f0cba0bbf590fd6d2baa325a5b6d56a595df2;hb=37b0c5724f06a98e14686695b5089f66ac657f11;hp=4c25e61907d1cb681aef73c607a63a823551f8c3;hpb=b750a5c3fb139dade6974a1f99a9d090ae706d5b;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 4c25e61..f03f0cb 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -84,6 +84,9 @@ bool CCECBusDevice::HandleCommand(const cec_command &command) { CLockObject lock(&m_writeMutex); m_iLastActive = GetTimeMs(); + + if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC) + m_deviceStatus = CEC_DEVICE_STATUS_PRESENT; } /* handle the command */ @@ -118,19 +121,20 @@ bool CCECBusDevice::PowerOn(void) { { CLockObject lock(&m_mutex); - m_powerStatus = CEC_POWER_STATUS_UNKNOWN; - } - cec_power_status status = GetPowerStatus(); - if (status == CEC_POWER_STATUS_STANDBY || status == CEC_POWER_STATUS_UNKNOWN) - { - /* sending the normal power on command appears to have failed */ - CStdString strLog; - strLog.Format("<< sending power on keypress to '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress); - AddLog(CEC_LOG_DEBUG, strLog.c_str()); - - TransmitKeypress(CEC_USER_CONTROL_CODE_POWER); - return TransmitKeyRelease(); +// m_powerStatus = CEC_POWER_STATUS_UNKNOWN; + m_powerStatus = CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON; } +// cec_power_status status = GetPowerStatus(); +// if (status == CEC_POWER_STATUS_STANDBY || status == CEC_POWER_STATUS_UNKNOWN) +// { +// /* sending the normal power on command appears to have failed */ +// CStdString strLog; +// strLog.Format("<< sending power on keypress to '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress); +// AddLog(CEC_LOG_DEBUG, strLog.c_str()); +// +// TransmitKeypress(CEC_USER_CONTROL_CODE_POWER); +// return TransmitKeyRelease(); +// } return true; } @@ -436,7 +440,7 @@ void CCECBusDevice::SetInactiveDevice(void) m_bActiveSource = false; } -void CCECBusDevice::SetActiveDevice(void) +void CCECBusDevice::SetActiveSource(void) { CLockObject lock(&m_writeMutex); @@ -749,7 +753,7 @@ bool CCECBusDevice::TransmitPowerState(cec_logical_address dest) return m_handler->TransmitPowerState(m_iLogicalAddress, dest, state); } -bool CCECBusDevice::TransmitVendorID(cec_logical_address dest) +bool CCECBusDevice::TransmitVendorID(cec_logical_address dest, bool bSendAbort /* = true */) { uint64_t iVendorId; { @@ -759,11 +763,14 @@ bool CCECBusDevice::TransmitVendorID(cec_logical_address dest) if (iVendorId == 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); + if (bSendAbort) + { + CStdString strLog; + strLog.Format("<< %s (%X) -> %s (%X): vendor id feature abort", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest); + AddLog(CEC_LOG_NOTICE, strLog); - m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); + m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); + } return false; } else