diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2017-02-16 12:20:45 +0100 |
---|---|---|
committer | Hans Verkuil <hans.verkuil@cisco.com> | 2017-02-16 12:20:45 +0100 |
commit | 8d8a29521a3a202268def8c3e648376fb5f4047e (patch) | |
tree | 874916415c6a666416af4dbebad880743684d96b /utils/cec-compliance/cec-test-power.cpp | |
parent | 13d54896bb9d984e41cb13175ba84e64ee522ba2 (diff) |
cec-compliance: add --timeout option
The default timeout for power-related messages is 60 seconds. Add the --timeout
option to make this configurable.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-compliance/cec-test-power.cpp')
-rw-r--r-- | utils/cec-compliance/cec-test-power.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp index 43067341..0f320ed2 100644 --- a/utils/cec-compliance/cec-test-power.cpp +++ b/utils/cec-compliance/cec-test-power.cpp @@ -256,10 +256,10 @@ static bool wait_changing_power_status(struct node *node, unsigned me, unsigned { __u8 old_status; - announce("Checking for power status change. This may take up to 60 s."); + announce("Checking for power status change. This may take up to %u s.", long_timeout); if (!get_power_status(node, me, la, old_status)) return false; - for (unsigned i = 0; i < 60 / SLEEP_POLL_POWER_STATUS; i++) { + for (unsigned i = 0; i < long_timeout / SLEEP_POLL_POWER_STATUS; i++) { __u8 power_status; if (!get_power_status(node, me, la, power_status)) { @@ -285,8 +285,8 @@ static bool poll_stable_power_status(struct node *node, unsigned me, unsigned la /* Some devices can use several seconds to transition from one power state to another, so the power state must be repeatedly polled */ - announce("Waiting for new stable power status. This may take up to 60 s."); - for (unsigned tries = 0; tries < 60 / SLEEP_POLL_POWER_STATUS; tries++) { + announce("Waiting for new stable power status. This may take up to %u s.", long_timeout); + for (unsigned tries = 0; tries < long_timeout / SLEEP_POLL_POWER_STATUS; tries++) { __u8 power_status; if (!get_power_status(node, me, la, power_status)) { |