aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2018-10-16 12:46:58 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2018-10-16 12:46:58 +0200
commitf57d2aebe6e1be63cc260bf76d66454e0610fcf7 (patch)
treeb1ffef191bcc6766f6b43466aaa15b2bc384d020 /utils/cec-compliance
parentc4cc439bf2ac37aa7f89bd070e0d603b21263972 (diff)
cec-compliance: improve tracing of CEC_TRANSMIT/RECEIVE
Give more information about the transmitted/received CEC message. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'utils/cec-compliance')
-rw-r--r--utils/cec-compliance/cec-compliance.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index f311a0d7..89f731e3 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -651,24 +651,28 @@ int cec_named_ioctl(struct node *node, const char *name,
warn("Both OK and MAX_RETRIES were set in tx_status! Applied workaround.\n");
}
- if (!retval && request == CEC_TRANSMIT && show_info) {
- printf("\t\t%s: Sequence: %u Tx Timestamp: %s Length: %u",
- opname.c_str(), msg->sequence, ts2s(msg->tx_ts).c_str(), msg->len);
- if (msg->rx_ts)
- printf("\n\t\t\tRx Timestamp: %s Approximate response time: %u ms",
- ts2s(msg->rx_ts).c_str(),
- response_time_ms(msg));
- if (msg->tx_status & ~CEC_TX_STATUS_OK)
- printf("\n\t\t\tStatus: %s", status2s(*msg).c_str());
- printf("\n");
+ if (!retval && show_info &&
+ (request == CEC_TRANSMIT || request == CEC_RECEIVE)) {
+ printf("\t\t%s: Sequence: %u Length: %u\n",
+ opname.c_str(), msg->sequence, msg->len);
+ if (msg->tx_ts || msg->rx_ts) {
+ printf("\t\t\t");
+ if (msg->tx_ts)
+ printf("Tx Timestamp: %s ", ts2s(msg->tx_ts).c_str());
+ if (msg->rx_ts)
+ printf("Rx Timestamp: %s", ts2s(msg->rx_ts).c_str());
+ printf("\n");
+ if (msg->tx_ts && msg->rx_ts)
+ printf("\t\t\tApproximate response time: %u ms\n",
+ response_time_ms(msg));
+ }
+ if ((msg->tx_status & ~CEC_TX_STATUS_OK) ||
+ (msg->rx_status & ~CEC_RX_STATUS_OK))
+ printf("\t\t\tStatus: %s\n", status2s(*msg).c_str());
if (msg->tx_status & CEC_TX_STATUS_TIMEOUT)
warn("CEC_TX_STATUS_TIMEOUT was set, should not happen.\n");
}
- if (!retval && request == CEC_RECEIVE && show_info)
- printf("\t\t%s: Sequence: %u Rx Timestamp: %s Length: %u\n",
- opname.c_str(), msg->sequence, ts2s(msg->rx_ts).c_str(), msg->len);
-
if (!retval) {
__u8 la = cec_msg_initiator(msg);

Privacy Policy