X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=7fe92a451236ec893e89ef47fd213e5ae164fb56;hb=9bc8934c6dac8efcd2f636b6f68798049f84deac;hp=0b7adf677e61bebed790af62f4e0650a69f6051a;hpb=5e5637c6334af5a4a8f30c8e23f64382a825934f;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 0b7adf6..7fe92a4 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -40,7 +40,7 @@ using namespace CEC; -#define ToString(p) CCECCommandHandler::ToString(p) +#define ToString(p) m_processor->ToString(p) CCECBusDevice::CCECBusDevice(CCECProcessor *processor, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress) : m_type(CEC_DEVICE_TYPE_RESERVED), @@ -99,7 +99,16 @@ bool CCECBusDevice::PowerOn(void) cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON); if (m_processor->Transmit(command)) { - RequestPowerStatus(); + { + 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) + { + SendKeypress(CEC_USER_CONTROL_CODE_POWER, true); + return SendKeyRelease(false); + } return true; }