diff options
author | Hans Verkuil <hansverk@cisco.com> | 2018-10-03 10:57:48 +0200 |
---|---|---|
committer | Hans Verkuil <hansverk@cisco.com> | 2018-10-03 11:01:23 +0200 |
commit | ba5cef6d356c6bbc9f9a3cfb0f778d3c4a518f5d (patch) | |
tree | d96b796e6d269a8fd1daf42d1ea8c7b199d1bd5a /utils | |
parent | 4ed1a5af20fb761002a63611e25afbfc98a23373 (diff) |
cec-ctl: turn -n into a toggle
The -n option turns off waiting for a reply, but there is no way
to turn it on again for later messages. Turn this into a toggle.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cec-ctl/cec-ctl.1.in | 4 | ||||
-rw-r--r-- | utils/cec-ctl/cec-ctl.cpp | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/utils/cec-ctl/cec-ctl.1.in b/utils/cec-ctl/cec-ctl.1.in index 53293339..d629077b 100644 --- a/utils/cec-ctl/cec-ctl.1.in +++ b/utils/cec-ctl/cec-ctl.1.in @@ -47,7 +47,9 @@ Clear all logical addresses, leaving the CEC device unconfigured. \fB\-n\fR, \fB\-\-no\-reply\fR By default when sending a CEC message that expects a reply this utility will wait for that reply. With this option it will just send it without waiting -for the reply. +for the reply. This option applies to the messages following this option. +It acts as a toggle, so after you specify it a second time then the following +messages will wait for a reply again. .TP \fB\-t\fR, \fB\-\-to\fR \fI<la>\fR Send the message to the given logical address (0-15). diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 07ab5a72..f9e8dcb7 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -641,7 +641,7 @@ enum Option { OptLogicalAddresses = 'L', OptMonitor = 'm', OptMonitorAll = 'M', - OptNoReply = 'n', + OptToggleNoReply = 'n', OptOsdName = 'o', OptPhysAddr = 'p', OptPoll = 'P', @@ -745,7 +745,7 @@ static struct option long_options[] = { { "ignore", required_argument, 0, OptIgnore }, { "store-pin", required_argument, 0, OptStorePin }, { "analyze-pin", required_argument, 0, OptAnalyzePin }, - { "no-reply", no_argument, 0, OptNoReply }, + { "no-reply", no_argument, 0, OptToggleNoReply }, { "logical-address", no_argument, 0, OptLogicalAddress }, { "logical-addresses", no_argument, 0, OptLogicalAddresses }, { "to", required_argument, 0, OptTo }, @@ -803,7 +803,7 @@ static void usage(void) " -l, --logical-address Show first configured logical address\n" " -L, --logical-addresses Show all configured logical addresses\n" " -C, --clear Clear all logical addresses\n" - " -n, --no-reply Don't wait for a reply\n" + " -n, --no-reply Toggle 'don't wait for a reply'\n" " -t, --to <la> Send message to the given logical address\n" " -f, --from <la> Send message from the given logical address\n" " By default use the first assigned logical address\n" @@ -1872,8 +1872,8 @@ int main(int argc, char **argv) case OptAnalyzePin: analyze_pin = optarg; break; - case OptNoReply: - reply = false; + case OptToggleNoReply: + reply = !reply; break; case OptPhysAddr: phys_addr = parse_phys_addr(optarg); |