diff options
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-10-18 13:42:47 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-10-18 13:42:47 +0200
commit9f1d1e0cf8dbdcfb8bc6d817734d85417960a054 (patch)
parent68fd71f0c8ec4c37513bdc5af09262270aafd606 (diff)
cec-compliance: wake up remote device if needed
Until now, if the remote device was in standby the test would just abort with a message that the remote device should be woken up manually. This patch changes this to attempt to automatically wake up the remote device. Basically it adds the 'Wake up' to the core tests, but it is only run if the remote device was in standby, otherwise it is skipped. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
3 files changed, 3 insertions, 5 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 2ef5a1f5..34ed9a81 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -472,6 +472,7 @@ extern const vec_remote_subtests audio_rate_ctl_subtests;
// cec-test-power.cpp
bool util_interactive_ensure_power_state(struct node *node, unsigned me, unsigned la, bool interactive,
__u8 target_pwr);
+int standby_resume_wakeup(struct node *node, unsigned me, unsigned la, bool interactive);
extern const vec_remote_subtests standby_subtests;
extern const vec_remote_subtests one_touch_play_subtests;
extern const vec_remote_subtests power_status_subtests;
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
index f1e302d6..c811af59 100644
--- a/utils/cec-compliance/cec-test-power.cpp
+++ b/utils/cec-compliance/cec-test-power.cpp
@@ -490,7 +490,7 @@ static int wakeup_source(struct node *node, unsigned me, unsigned la)
return wakeup_rc(node, me, la);
-static int standby_resume_wakeup(struct node *node, unsigned me, unsigned la, bool interactive)
+int standby_resume_wakeup(struct node *node, unsigned me, unsigned la, bool interactive)
if (!node->remote[la].in_standby)
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 6a6a9040..5c8aa159 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -264,6 +264,7 @@ int core_abort(struct node *node, unsigned me, unsigned la, bool interactive)
static const vec_remote_subtests core_subtests{
+ { "Wake up", CEC_LOG_ADDR_MASK_ALL, standby_resume_wakeup, true },
{ "Feature aborts unknown messages", CEC_LOG_ADDR_MASK_ALL, core_unknown },
{ "Feature aborts Abort message", CEC_LOG_ADDR_MASK_ALL, core_abort },
@@ -1160,10 +1161,6 @@ void testRemote(struct node *node, unsigned me, unsigned la, unsigned test_tags,
if (!util_interactive_ensure_power_state(node, me, la, interactive, CEC_OP_POWER_STATUS_ON))
- if (node->remote[la].in_standby && !interactive) {
- announce("The remote device is in standby. It should be powered on when testing. Aborting.");
- return;
- }
if (!node->remote[la].has_power_status) {
announce("The device didn't support Give Device Power Status.");
announce("Assuming that the device is powered on.");

Privacy Policy