aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-18 15:27:32 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-18 15:35:56 +0100
commitcb7dcd48554a17971858cb98c3e729cb656ee326 (patch)
tree57df5a808e7883c35967679166bf33c24cb6f5ca
parentb62d322d4401e6b6e5cbd78cedad9eb69dac1324 (diff)
libcecutil: translate abort_msg to a message string
The Feature Abort message returns the message command that caused the Feature Abort. Show this number also as the name of the corresponding command (if any) for easier debugging. I.e., instead of just showing the message number: Transmitted by TV to Playback Device 1 (0 to 4): CEC_MSG_GIVE_DEVICE_POWER_STATUS (0x8f) Received from Playback Device 1 to TV (4 to 0): CEC_MSG_FEATURE_ABORT (0x00): abort-msg: 143 (0x8f) reason: unrecognized-op (0x00) now also show the message name: Transmitted by TV to Playback Device 1 (0 to 4): CEC_MSG_GIVE_DEVICE_POWER_STATUS (0x8f) Received from Playback Device 1 to TV (4 to 0): CEC_MSG_FEATURE_ABORT (0x00): abort-msg: 143 (0x8f, CEC_MSG_GIVE_DEVICE_POWER_STATUS) reason: unrecognized-op (0x00) Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/libcecutil/cec-log.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
index 77e026f0..f670cba4 100644
--- a/utils/libcecutil/cec-log.cpp
+++ b/utils/libcecutil/cec-log.cpp
@@ -47,11 +47,18 @@ static void log_arg(const struct cec_arg *arg, const char *arg_name, __u32 val)
/* fall through */
case CEC_ARG_TYPE_U8:
if (!strcmp(arg_name, "video-latency") ||
- !strcmp(arg_name, "audio-out-delay"))
+ !strcmp(arg_name, "audio-out-delay")) {
printf("\t%s: %u (0x%02x, %d ms)\n", arg_name, val, val,
(val - 1) * 2);
- else
+ } else if (!strcmp(arg_name, "abort-msg")) {
+ if (cec_opcode2s(val))
+ printf("\t%s: %u (0x%02x, CEC_MSG_%s)\n",
+ arg_name, val, val, cec_opcode2s(val));
+ else
+ printf("\t%s: %u (0x%02x)\n", arg_name, val, val);
+ } else {
printf("\t%s: %u (0x%02x)\n", arg_name, val, val);
+ }
return;
case CEC_ARG_TYPE_U16:
if (strstr(arg_name, "phys-addr"))

Privacy Policy