aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-12-07 12:36:36 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2016-12-07 12:36:36 +0100
commit188e604d57bec065078ff772c802b93ddb6def4b (patch)
treefb415f8a6f29e959fad4ce286ace24743b0529f4
parent20ded57a085630446857ec4c320d7e4ea9ccb882 (diff)
cec-compliance: only test for has_deck_ctl for playback and record devices
The CEC 2.0 has_deck_ctl tests should only be done for playback and record devices. Other devices do not set that feature. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/cec-compliance/cec-compliance.h5
-rw-r--r--utils/cec-compliance/cec-test.cpp30
2 files changed, 23 insertions, 12 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index d59ec1db..44dc6143 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -287,6 +287,11 @@ static inline bool is_tv(unsigned la, unsigned prim_type)
(cec_has_specific(1 << la) && prim_type == CEC_OP_PRIM_DEVTYPE_TV);
}
+static inline bool is_playback_or_rec(unsigned la)
+{
+ return cec_has_playback(1 << la) || cec_has_record(1 << la);
+}
+
static inline bool cec_msg_status_is_abort(const struct cec_msg *msg)
{
return msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT;
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index c276a81d..88972221 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -617,10 +617,12 @@ static int deck_ctl_give_status(struct node *node, unsigned me, unsigned la, boo
cec_msg_give_deck_status(&msg, true, CEC_OP_STATUS_REQ_ONCE);
fail_on_test(!transmit_timeout(node, &msg));
fail_on_test(timed_out(&msg));
- fail_on_test_v2(node->remote[la].cec_version,
- node->remote[la].has_deck_ctl && cec_msg_status_is_abort(&msg));
- fail_on_test_v2(node->remote[la].cec_version,
- !node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
+ if (is_playback_or_rec(la)) {
+ fail_on_test_v2(node->remote[la].cec_version,
+ node->remote[la].has_deck_ctl && cec_msg_status_is_abort(&msg));
+ fail_on_test_v2(node->remote[la].cec_version,
+ !node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
+ }
if (unrecognized_op(&msg))
return NOTSUPPORTED;
if (refused(&msg))
@@ -655,10 +657,12 @@ static int deck_ctl_deck_ctl(struct node *node, unsigned me, unsigned la, bool i
cec_msg_init(&msg, me, la);
cec_msg_deck_control(&msg, CEC_OP_DECK_CTL_MODE_STOP);
fail_on_test(!transmit_timeout(node, &msg));
- fail_on_test_v2(node->remote[la].cec_version,
- node->remote[la].has_deck_ctl && unrecognized_op(&msg));
- fail_on_test_v2(node->remote[la].cec_version,
- !node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
+ if (is_playback_or_rec(la)) {
+ fail_on_test_v2(node->remote[la].cec_version,
+ node->remote[la].has_deck_ctl && unrecognized_op(&msg));
+ fail_on_test_v2(node->remote[la].cec_version,
+ !node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
+ }
if (unrecognized_op(&msg))
return NOTSUPPORTED;
if (refused(&msg))
@@ -676,10 +680,12 @@ static int deck_ctl_play(struct node *node, unsigned me, unsigned la, bool inter
cec_msg_init(&msg, me, la);
cec_msg_play(&msg, CEC_OP_PLAY_MODE_PLAY_STILL);
fail_on_test(!transmit_timeout(node, &msg));
- fail_on_test_v2(node->remote[la].cec_version,
- node->remote[la].has_deck_ctl && unrecognized_op(&msg));
- fail_on_test_v2(node->remote[la].cec_version,
- !node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
+ if (is_playback_or_rec(la)) {
+ fail_on_test_v2(node->remote[la].cec_version,
+ node->remote[la].has_deck_ctl && unrecognized_op(&msg));
+ fail_on_test_v2(node->remote[la].cec_version,
+ !node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
+ }
if (unrecognized_op(&msg))
return NOTSUPPORTED;
if (refused(&msg))

Privacy Policy