aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-02-19 08:46:33 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-02-19 08:46:33 (GMT)
commit1e2477477bb9513ea89efdb95d1016ef6c3e211a (patch)
tree733608a810d50f9680f8e07ed9c5713f3008e1cc
parentd37570cc4572b7e44bce3e414a438b5a1279f927 (diff)
cec-ctl: fix transmitting broadcast commands
If a broadcast command was transmitted, but there was no --to option before that broadcast command option, then the 'from' value was 0xf and the transmit was rejected. Fix this by always clearing the top 4 bits before writing the initiator. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-ctl/cec-ctl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 8221f7e..c2f8e13 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -1756,7 +1756,7 @@ int main(int argc, char **argv)
break;
cec_msg_init(&msg, 0, 0);
- msg.msg[0] = cec_msg_is_broadcast(&msg) ? 0xf : (options[OptTo] ? to : 0xf0);
+ msg.msg[0] = options[OptTo] ? to : 0xf0;
options[(int)ch] = 1;
switch (ch) {
@@ -2395,6 +2395,7 @@ int main(int argc, char **argv)
}
if (msg.msg[0] == 0xf0)
msg.msg[0] = first_to;
+ msg.msg[0] &= 0x0f;
msg.msg[0] |= from << 4;
to = msg.msg[0] & 0xf;
printf("\nTransmit from %s to %s (%d to %d):\n",

Privacy Policy