diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-10-08 16:44:17 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-10-08 16:44:17 +0200 |
commit | fb4f059c875c9f9859cc5bce36c8170fc24f375d (patch) | |
tree | b4b356b2129f561c8f2ffc2cf776ff5ba9c3a144 | |
parent | 3725b644a252bf956a92d42455255f9838468905 (diff) | |
download | v4l-utils-fb4f059c875c9f9859cc5bce36c8170fc24f375d.tar.gz |
cec-compliance: fix confusing 'Transient state' message
Fix confusing messages like this:
Transient state after 0 s, stable state On after 0 s
This really means that no transient state was reported, and only
a stable state.
Report this as such.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | utils/cec-compliance/cec-test-power.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp index 7b10096b..f1e302d6 100644 --- a/utils/cec-compliance/cec-test-power.cpp +++ b/utils/cec-compliance/cec-test-power.cpp @@ -304,8 +304,12 @@ static bool poll_stable_power_status(struct node *node, unsigned me, unsigned la power_status == CEC_OP_POWER_STATUS_TO_ON); } if (power_status == expected_status) { - announce("Transient state after %d s, stable state %s after %d s", - time_to_transient, power_status2s(power_status), (int)(time(NULL) - t)); + if (transient) + announce("Transient state after %d s, stable state %s after %d s", + time_to_transient, power_status2s(power_status), (int)(time(NULL) - t)); + else + announce("No transient state reported, stable state %s after %d s", + power_status2s(power_status), (int)(time(NULL) - t)); return true; } sleep(SLEEP_POLL_POWER_STATUS); |