diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2018-10-10 12:57:18 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2018-10-10 12:57:18 +0200 |
commit | dcac09d7dc861e9bd7e2e4346479b32d021fe925 (patch) | |
tree | 41ff68e2b27a273e9190cd10c9a30d87f3877e4f /utils | |
parent | 06ad469e966aafaf39c1cc76e6e0953ec7d4f9c9 (diff) |
cec-ctl: show non-OK status in verbose monitor mode
When monitoring messages and if -v was passed, then show the message
status unless everything was OK.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cec-ctl/cec-ctl.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 126cfa08..d2876bcc 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -1307,12 +1307,18 @@ static void show_msg(const cec_msg &msg) log_msg(&msg); if (options[OptShowRaw]) log_raw_msg(&msg); + std::string status; + if ((msg.tx_status & ~CEC_TX_STATUS_OK) || + (msg.rx_status & ~CEC_RX_STATUS_OK)) + status = status2s(msg); if (verbose && transmitted) - printf("\tSequence: %u Tx Timestamp: %s\n", - msg.sequence, ts2s(msg.tx_ts).c_str()); + printf("\tSequence: %u Tx Timestamp: %s %s\n", + msg.sequence, ts2s(msg.tx_ts).c_str(), + status.c_str()); else if (verbose && !transmitted) - printf("\tSequence: %u Rx Timestamp: %s\n", - msg.sequence, ts2s(msg.rx_ts).c_str()); + printf("\tSequence: %u Rx Timestamp: %s %s\n", + msg.sequence, ts2s(msg.rx_ts).c_str(), + status.c_str()); } static void wait_for_msgs(struct node &node, __u32 monitor_time) |