aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-08-25 13:05:21 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-08-25 13:05:21 +0200
commit22466798f9a9044fa20ae3bb367d9fc29d37e054 (patch)
tree5748b9d2ab9c4ce65c71781711c38b2f32f6201e
parent58f4f974944c182890a09d040418dafa9a431e45 (diff)
cec-compliance: fix broken timer tests
If the remote device doesn't support the Timer Feature, then do not attempt to test for timer errors or overlapped timers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-compliance/cec-compliance.h1
-rw-r--r--utils/cec-compliance/cec-test-tuner-record-timer.cpp9
2 files changed, 9 insertions, 1 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 08365e07..2ef5a1f5 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -147,6 +147,7 @@ struct remote {
__u8 mute;
bool has_aud_rate;
bool has_deck_ctl;
+ bool has_analogue_timer;
__u8 bcast_sys;
__u8 dig_bcast_sys;
bool has_rec_tv;
diff --git a/utils/cec-compliance/cec-test-tuner-record-timer.cpp b/utils/cec-compliance/cec-test-tuner-record-timer.cpp
index 1ba5a135..f52c52dd 100644
--- a/utils/cec-compliance/cec-test-tuner-record-timer.cpp
+++ b/utils/cec-compliance/cec-test-tuner-record-timer.cpp
@@ -680,7 +680,7 @@ static int send_timer_error(struct node *node, unsigned me, unsigned la, __u8 da
fail_on_test(!transmit_timeout(node, &msg, 10000));
fail_on_test(timed_out(&msg));
if (cec_msg_status_is_abort(&msg))
- fail_on_test(abort_reason(&msg) != CEC_OP_ABORT_INVALID_OP);
+ fail_on_test(abort_reason(&msg) != CEC_OP_ABORT_UNRECOGNIZED_OP);
else
fail_on_test(!timer_has_error(msg));
@@ -759,6 +759,7 @@ static int timer_prog_set_analog_timer(struct node *node, unsigned me, unsigned
if (cec_msg_status_is_abort(&msg))
return OK_PRESUMED;
fail_on_test(timer_status_is_valid(msg));
+ node->remote[la].has_analogue_timer = true;
return OK;
}
@@ -908,6 +909,9 @@ static int timer_errors(struct node *node, unsigned me, unsigned la, bool intera
{
struct cec_msg msg;
+ if (!node->remote[la].has_analogue_timer)
+ return OK_NOT_SUPPORTED;
+
/* Day error: November 31, at 6:00 am, for 1 hr. */
fail_on_test(send_timer_error(node, me, la, 31, Nov, 6, 0, 1, 0, CEC_OP_REC_SEQ_ONCE_ONLY));
@@ -973,6 +977,9 @@ static int timer_overlap_warning(struct node *node, unsigned me, unsigned la, bo
time_t tomorrow = node->current_time + (24 * 60 * 60);
struct tm *t = localtime(&tomorrow);
+ if (!node->remote[la].has_analogue_timer)
+ return OK_NOT_SUPPORTED;
+
/* No overlap: set timer for tomorrow at 8:00 am for 2 hr. */
cec_msg_init(&msg, me, la);
cec_msg_set_analogue_timer(&msg, true, t->tm_mday, t->tm_mon + 1, 8, 0, 2, 0,

Privacy Policy