path: root/utils/cec-compliance/cec-compliance.h
diff options
authorJohan Fjeldtvedt <jaffe1@gmail.com>2016-08-15 14:14:43 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-08-15 14:58:25 +0200
commit0698807de7ee480fe5616a80a6c6354140d70860 (patch)
treeef7debf61316e4aa0e8fcbd581b5a7a2566f6d64 /utils/cec-compliance/cec-compliance.h
parenta1cdac7dcdc72ff8b5bcae9b01eafb9550640a13 (diff)
cec-compliance/follower: fix opcode printing
This contains some small fixes for printing opcodes correctly: opcode2s should print the message's opcode (based on byte 1), not the Aborted Message operand for Feature Abort messages (byte 2). When printing unknown opcode numbers, __u8 must be converted to unsigned to not print the numbers as characters. In transmit_timeout the original message struct is kept in order to print the original message opcode when a Feature Abort occurs. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-compliance/cec-compliance.h')
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 6ee74029..cb236fdc 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -333,7 +333,7 @@ static inline unsigned response_time_ms(const struct cec_msg *msg)
static inline bool transmit_timeout(struct node *node, struct cec_msg *msg,
unsigned timeout = 2000)
- bool broadcast = cec_msg_is_broadcast(msg);
+ struct cec_msg original_msg = *msg;
msg->timeout = timeout;
if (doioctl(node, CEC_TRANSMIT, msg) ||
@@ -347,7 +347,7 @@ static inline bool transmit_timeout(struct node *node, struct cec_msg *msg,
if (!cec_msg_status_is_abort(msg))
return true;
- if (broadcast) {
+ if (cec_msg_is_broadcast(&original_msg)) {
fail("Received Feature Abort in reply to broadcast message\n");
return false;
@@ -375,7 +375,7 @@ static inline bool transmit_timeout(struct node *node, struct cec_msg *msg,
info("Opcode %s was replied to with Feature Abort [%s]\n",
- opcode2s(msg).c_str(), reason);
+ opcode2s(&original_msg).c_str(), reason);
return true;

Privacy Policy