aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance
diff options
context:
space:
mode:
authorHans Verkuil <hansverk@cisco.com>2018-06-06 12:07:22 +0200
committerHans Verkuil <hansverk@cisco.com>2018-06-06 12:07:22 +0200
commit9c7d34b857fbd4f5b63b36683e4aca54748f6374 (patch)
tree3ac82aac8b6eba350dd8d43fe8e97e21faf54394 /utils/cec-compliance
parent093969d4957b6ce6f72a8920dbf939fa17a7e2df (diff)
cec-compliance: improve tx_status checks
Check that OK and MAX_RETRIES cannot both be set. If error status bits were set, then show the status instead of only showing the transmit status if there was an error, but OK was still set. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Diffstat (limited to 'utils/cec-compliance')
-rw-r--r--utils/cec-compliance/cec-compliance.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index 1781a6ca..b7dcbc3a 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -702,6 +702,10 @@ int cec_named_ioctl(struct node *node, const char *name,
name, retval, strerror(e));
}
+ if (!retval && request == CEC_TRANSMIT &&
+ (msg->tx_status & CEC_TX_STATUS_OK) && ((msg->tx_status & CEC_TX_STATUS_MAX_RETRIES)))
+ warn("Both OK and MAX_RETRIES were set in tx_status!\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);
@@ -709,9 +713,8 @@ int cec_named_ioctl(struct node *node, const char *name,
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) &&
- (msg->tx_status & (CEC_TX_STATUS_ARB_LOST | CEC_TX_STATUS_NACK |
- CEC_TX_STATUS_LOW_DRIVE | CEC_TX_STATUS_ERROR)))
+ if (msg->tx_status & (CEC_TX_STATUS_ARB_LOST | CEC_TX_STATUS_NACK |
+ CEC_TX_STATUS_LOW_DRIVE | CEC_TX_STATUS_ERROR))
printf("\n\t\t\tStatus: %s", status2s(*msg).c_str());
printf("\n");
}

Privacy Policy