From: Lars Op den Kamp Date: Wed, 5 Sep 2012 09:26:35 +0000 (+0200) Subject: rpi: handle vendor specific remote control presses. closes #42 X-Git-Tag: upstream/2.2.0~1^2~18^2^2~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3b106c7d018681dec102db878a9ca4cbd213c1e2;p=deb_libcec.git rpi: handle vendor specific remote control presses. closes #42 --- diff --git a/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp b/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp index a89ebf6..9176647 100644 --- a/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp +++ b/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp @@ -168,10 +168,14 @@ void CRPiCECAdapterCommunication::OnDataReceived(uint32_t header, uint32_t p0, u } break; case VC_CEC_BUTTON_PRESSED: + case VC_CEC_REMOTE_PRESSED: { // translate into a cec_command cec_command command; - cec_command::Format(command, (cec_logical_address)CEC_CB_INITIATOR(p0), (cec_logical_address)CEC_CB_FOLLOWER(p0), CEC_OPCODE_USER_CONTROL_PRESSED); + cec_command::Format(command, + (cec_logical_address)CEC_CB_INITIATOR(p0), + (cec_logical_address)CEC_CB_FOLLOWER(p0), + reason == VC_CEC_BUTTON_PRESSED ? CEC_OPCODE_USER_CONTROL_PRESSED : CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN); command.parameters.PushBack((uint8_t)CEC_CB_OPERAND1(p0)); // send to libCEC @@ -179,10 +183,14 @@ void CRPiCECAdapterCommunication::OnDataReceived(uint32_t header, uint32_t p0, u } break; case VC_CEC_BUTTON_RELEASE: + case VC_CEC_REMOTE_RELEASE: { // translate into a cec_command cec_command command; - cec_command::Format(command, (cec_logical_address)CEC_CB_INITIATOR(p0), (cec_logical_address)CEC_CB_FOLLOWER(p0), CEC_OPCODE_USER_CONTROL_RELEASE); + cec_command::Format(command, + (cec_logical_address)CEC_CB_INITIATOR(p0), + (cec_logical_address)CEC_CB_FOLLOWER(p0), + reason == VC_CEC_BUTTON_PRESSED ? CEC_OPCODE_USER_CONTROL_RELEASE : CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP); command.parameters.PushBack((uint8_t)CEC_CB_OPERAND1(p0)); // send to libCEC @@ -220,8 +228,6 @@ void CRPiCECAdapterCommunication::OnDataReceived(uint32_t header, uint32_t p0, u } break; case VC_CEC_TOPOLOGY: - case VC_CEC_REMOTE_PRESSED: - case VC_CEC_REMOTE_RELEASE: break; default: LIB_CEC->AddLog(CEC_LOG_DEBUG, "ignoring unknown reason %x", reason);