aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-02 10:06:05 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-02 10:06:05 +0200
commitca747c9fc0824a625ea4ac939ffc5e44cbb2b994 (patch)
tree18df3e381743692712ea8c848c46ec1003fa91a4
parent0ebaa8818c5c7ceb4c4914ea3ea7afb22dc78a38 (diff)
cec-ctl/cec-log: use new CEC_OP_UI_CMD defines
Rather than hardcode the UI commands, use the new defines. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-ctl/cec-ctl.cpp46
-rw-r--r--utils/common/cec-log.cpp24
2 files changed, 35 insertions, 35 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 336a7bf5..10cba50e 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -147,29 +147,29 @@ static struct cec_op_ui_command *args2ui_command(__u8 ui_cmd,
if (!has_opt_arg)
return &ui_command;
switch (ui_cmd) {
- case 0x56:
+ case CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE:
ui_command.ui_broadcast_type = ui_bcast_type;
break;
- case 0x57:
+ case CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION:
ui_command.ui_sound_presentation_control = ui_snd_pres_ctl;
break;
- case 0x60:
+ case CEC_OP_UI_CMD_PLAY_FUNCTION:
ui_command.play_mode = play_mode;
break;
- case 0x68:
+ case CEC_OP_UI_CMD_TUNE_FUNCTION:
+ ui_command.channel_identifier.channel_number_fmt = channel_number_fmt;
+ ui_command.channel_identifier.major = major;
+ ui_command.channel_identifier.minor = minor;
+ break;
+ case CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION:
ui_command.ui_function_media = ui_function_media;
break;
- case 0x69:
+ case CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION:
ui_command.ui_function_select_av_input = ui_function_select_av_input;
break;
- case 0x6a:
+ case CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION:
ui_command.ui_function_select_audio_input = ui_function_select_audio_input;
break;
- case 0x67:
- ui_command.channel_identifier.channel_number_fmt = channel_number_fmt;
- ui_command.channel_identifier.major = major;
- ui_command.channel_identifier.minor = minor;
- break;
default:
ui_command.has_opt_arg = false;
break;
@@ -439,32 +439,32 @@ static void log_ui_command(const char *arg_name,
if (!ui_cmd->has_opt_arg)
return;
switch (ui_cmd->ui_cmd) {
- case 0x56:
+ case CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE:
log_arg(&arg_ui_bcast_type, "ui-broadcast-type",
ui_cmd->ui_broadcast_type);
break;
- case 0x57:
+ case CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION:
log_arg(&arg_ui_snd_pres_ctl, "ui-sound-presentation-control",
ui_cmd->ui_sound_presentation_control);
break;
- case 0x60:
+ case CEC_OP_UI_CMD_PLAY_FUNCTION:
log_arg(&arg_u8, "play-mode", ui_cmd->play_mode);
break;
- case 0x68:
+ case CEC_OP_UI_CMD_TUNE_FUNCTION:
+ log_arg(&arg_channel_number_fmt, "channel-number-fmt",
+ ui_cmd->channel_identifier.channel_number_fmt);
+ log_arg(&arg_u16, "major", ui_cmd->channel_identifier.major);
+ log_arg(&arg_u16, "minor", ui_cmd->channel_identifier.minor);
+ break;
+ case CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION:
log_arg(&arg_u8, "ui-function-media", ui_cmd->ui_function_media);
break;
- case 0x69:
+ case CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION:
log_arg(&arg_u8, "ui-function-select-av-input", ui_cmd->ui_function_select_av_input);
break;
- case 0x6a:
+ case CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION:
log_arg(&arg_u8, "ui-function-select-audio-input", ui_cmd->ui_function_select_audio_input);
break;
- case 0x67:
- log_arg(&arg_channel_number_fmt, "channel-number-fmt",
- ui_cmd->channel_identifier.channel_number_fmt);
- log_arg(&arg_u16, "major", ui_cmd->channel_identifier.major);
- log_arg(&arg_u16, "minor", ui_cmd->channel_identifier.minor);
- break;
}
}
diff --git a/utils/common/cec-log.cpp b/utils/common/cec-log.cpp
index cc15348f..c55d8679 100644
--- a/utils/common/cec-log.cpp
+++ b/utils/common/cec-log.cpp
@@ -212,32 +212,32 @@ static void log_ui_command(const char *arg_name,
if (!ui_cmd->has_opt_arg)
return;
switch (ui_cmd->ui_cmd) {
- case 0x56:
+ case CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE:
log_arg(&arg_ui_bcast_type, "ui-broadcast-type",
ui_cmd->ui_broadcast_type);
break;
- case 0x57:
+ case CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION:
log_arg(&arg_ui_snd_pres_ctl, "ui-sound-presentation-control",
ui_cmd->ui_sound_presentation_control);
break;
- case 0x60:
+ case CEC_OP_UI_CMD_PLAY_FUNCTION:
log_arg(&arg_u8, "play-mode", ui_cmd->play_mode);
break;
- case 0x68:
+ case CEC_OP_UI_CMD_TUNE_FUNCTION:
+ log_arg(&arg_channel_number_fmt, "channel-number-fmt",
+ ui_cmd->channel_identifier.channel_number_fmt);
+ log_arg(&arg_u16, "major", ui_cmd->channel_identifier.major);
+ log_arg(&arg_u16, "minor", ui_cmd->channel_identifier.minor);
+ break;
+ case CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION:
log_arg(&arg_u8, "ui-function-media", ui_cmd->ui_function_media);
break;
- case 0x69:
+ case CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION:
log_arg(&arg_u8, "ui-function-select-av-input", ui_cmd->ui_function_select_av_input);
break;
- case 0x6a:
+ case CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION:
log_arg(&arg_u8, "ui-function-select-audio-input", ui_cmd->ui_function_select_audio_input);
break;
- case 0x67:
- log_arg(&arg_channel_number_fmt, "channel-number-fmt",
- ui_cmd->channel_identifier.channel_number_fmt);
- log_arg(&arg_u16, "major", ui_cmd->channel_identifier.major);
- log_arg(&arg_u16, "minor", ui_cmd->channel_identifier.minor);
- break;
}
}

Privacy Policy