aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Fjeldtvedt <jaffe1@gmail.com>2016-08-12 13:21:50 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-08-12 13:32:06 +0200
commitb7112ed3fe53e75b5789d8148195e823442ead0d (patch)
treea74cb80b82869e95fe91c75d4c37d3dd7a70ee21
parent6547e0880083f18302c7e4d436a1d4f3620318c2 (diff)
cec-compliance: add missing test for Report Power Status
This checks whether Report Power Status is supported. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/cec-compliance/cec-test-power.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
index 5145ecda..e88e3387 100644
--- a/utils/cec-compliance/cec-test-power.cpp
+++ b/utils/cec-compliance/cec-test-power.cpp
@@ -70,7 +70,7 @@ bool util_interactive_ensure_power_state(struct node *node, unsigned me, unsigne
/* Give Device Power Status */
-static int power_status_probe(struct node *node, unsigned me, unsigned la, bool interactive)
+static int power_status_give(struct node *node, unsigned me, unsigned la, bool interactive)
{
struct cec_msg msg = { };
@@ -91,8 +91,24 @@ static int power_status_probe(struct node *node, unsigned me, unsigned la, bool
return 0;
}
+static int power_status_report(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ struct cec_msg msg = {};
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_report_power_status(&msg, CEC_OP_POWER_STATUS_ON);
+ fail_on_test(!transmit_timeout(node, &msg));
+ if (unrecognized_op(&msg))
+ return NOTSUPPORTED;
+ if (refused(&msg))
+ return REFUSED;
+
+ return PRESUMED_OK;
+}
+
struct remote_subtest power_status_subtests[] = {
- { "Give Device Power Status", CEC_LOG_ADDR_MASK_ALL, power_status_probe },
+ { "Give Device Power Status", CEC_LOG_ADDR_MASK_ALL, power_status_give },
+ { "Report Device Power Status", CEC_LOG_ADDR_MASK_ALL, power_status_report },
};
const unsigned power_status_subtests_size = ARRAY_SIZE(power_status_subtests);

Privacy Policy