This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:
Subject: cec-ctl: add --show-raw option Author: Hans Verkuil <[email protected]> Date: Wed Feb 15 14:59:50 2017 +0100 If the --show-raw option is specified, then the received messages are also displayed as a hex dump. This is especially useful when examining vendor specific messages. Signed-off-by: Hans Verkuil <[email protected]> utils/cec-ctl/cec-ctl.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) --- http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=76192f2b4908848be48ed0442cf7a47de0acc4b6 diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index f03d9f452792..846e9623a1d3 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -642,6 +642,7 @@ enum Option { OptNoReply = 'n', OptOsdName = 'o', OptPhysAddr = 'p', + OptShowRaw = 'r', OptShowTopology = 'S', OptTo = 't', OptTrace = 'T', @@ -726,6 +727,7 @@ static struct option long_options[] = { { "no-reply", no_argument, 0, OptNoReply }, { "to", required_argument, 0, OptTo }, { "from", required_argument, 0, OptFrom }, + { "show-raw", no_argument, 0, OptShowRaw }, { "show-topology", no_argument, 0, OptShowTopology }, { "list-ui-commands", no_argument, 0, OptListUICommands }, { "rc-tv-profile-1", no_argument, 0, OptRcTVProfile1 }, @@ -779,6 +781,7 @@ static void usage(void) " -t, --to=<la> Send message to the given logical address\n" " -f, --from=<la> Send message from the given logical address\n" " By default use the first assigned logical address\n" + " -r, --show-raw Show the raw CEC message (hex values)\n" " -S, --show-topology Show the CEC topology\n" " -h, --help Display this help message\n" " --help-all Show all help messages\n" @@ -1117,6 +1120,14 @@ int cec_named_ioctl(int fd, const char *name, return retval == -1 ? e : (retval ? -1 : 0); } +static void log_raw_msg(const struct cec_msg *msg) +{ + printf("\tRaw: "); + for (unsigned i = 0; i < msg->len; i++) + printf("%02x ", msg->msg[i]); + printf("\n"); +} + static void log_unknown_msg(const struct cec_msg *msg) { __u32 vendor_id; @@ -2054,6 +2065,8 @@ int main(int argc, char **argv) printf(" Received from %s (%d):\n ", la2s(cec_msg_initiator(&msg)), cec_msg_initiator(&msg)); log_msg(&msg); + if (options[OptShowRaw]) + log_raw_msg(&msg); } printf("\tSequence: %u Tx Timestamp: %llu.%03llus", msg.sequence, @@ -2120,6 +2133,8 @@ skip_la: transmitted ? "Transmitted by" : "Received from", la2s(from), to == 0xf ? "all" : la2s(to), from, to); log_msg(&msg); + if (options[OptShowRaw]) + log_raw_msg(&msg); if (show_info && transmitted) printf("\tSequence: %u Tx Timestamp: %llu.%03llus\n", msg.sequence, _______________________________________________ linuxtv-commits mailing list [email protected] https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
