From: Lars Op den Kamp Date: Thu, 26 Apr 2012 10:35:35 +0000 (+0200) Subject: cec: added GetResponseOpcode(cec_opcode opcode) to cec_command X-Git-Tag: upstream/2.2.0~1^2~29^2^2~34 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=24d82513b7f6fa67fedef20bf53019d8eec8b9ad;p=deb_libcec.git cec: added GetResponseOpcode(cec_opcode opcode) to cec_command --- diff --git a/include/cectypes.h b/include/cectypes.h index 034a5f1..48bb70f 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -834,6 +834,43 @@ typedef struct cec_command transmit_timeout = CEC_DEFAULT_TRANSMIT_TIMEOUT; parameters.Clear(); }; + + static cec_opcode GetResponseOpcode(cec_opcode opcode) + { + switch (opcode) + { + case CEC_OPCODE_REQUEST_ACTIVE_SOURCE: + return CEC_OPCODE_ACTIVE_SOURCE; + case CEC_OPCODE_GET_CEC_VERSION: + return CEC_OPCODE_CEC_VERSION; + case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS: + return CEC_OPCODE_REPORT_PHYSICAL_ADDRESS; + case CEC_OPCODE_GET_MENU_LANGUAGE: + return CEC_OPCODE_SET_MENU_LANGUAGE; + case CEC_OPCODE_GIVE_DECK_STATUS: + return CEC_OPCODE_DECK_STATUS; + case CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS: + return CEC_OPCODE_TUNER_DEVICE_STATUS; + case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID: + return CEC_OPCODE_DEVICE_VENDOR_ID; + case CEC_OPCODE_GIVE_OSD_NAME: + return CEC_OPCODE_GIVE_OSD_NAME; + case CEC_OPCODE_MENU_REQUEST: + return CEC_OPCODE_MENU_STATUS; + case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS: + return CEC_OPCODE_REPORT_POWER_STATUS; + case CEC_OPCODE_GIVE_AUDIO_STATUS: + return CEC_OPCODE_REPORT_AUDIO_STATUS; + case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS: + return CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS; + case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST: + return CEC_OPCODE_SET_SYSTEM_AUDIO_MODE; + default: + break; + } + + return CEC_OPCODE_FEATURE_ABORT; + } #endif } cec_command;