aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Fjeldtvedt <jaffe1@gmail.com>2016-08-11 13:32:27 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-08-12 13:27:53 +0200
commit33958de6f7832b79bfd189244a300418cb5de842 (patch)
treed2f83e2504cc373ad81648d831b9800542d702e6
parente9017b0275813b5eb84ea46f62cd631f07139ae9 (diff)
cec-compliance: fix return reason when feature aborted
When Feature Abort (but recognized opcode) we currently warn, but we should also return PRESUMED_OK as the abort reason. 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-audio.cpp32
-rw-r--r--utils/cec-compliance/cec-test-power.cpp12
-rw-r--r--utils/cec-compliance/cec-test.cpp22
3 files changed, 59 insertions, 7 deletions
diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
index df998c61..509fe894 100644
--- a/utils/cec-compliance/cec-test-audio.cpp
+++ b/utils/cec-compliance/cec-test-audio.cpp
@@ -199,6 +199,8 @@ static int arc_initiate_tx(struct node *node, unsigned me, unsigned la, bool int
}
else if (cec_msg_opcode(&msg) == CEC_MSG_REPORT_ARC_TERMINATED)
announce("Device supports ARC but is not ready to initiate.");
+ else if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -222,6 +224,10 @@ static int arc_terminate_tx(struct node *node, unsigned me, unsigned la, bool in
return PRESUMED_OK;
}
fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg)) {
+ warn("Received Feature Abort for Terminate ARC (but the message was recognized).");
+ return PRESUMED_OK;
+ }
return 0;
}
@@ -290,6 +296,10 @@ static int arc_terminate_rx(struct node *node, unsigned me, unsigned la, bool in
return PRESUMED_OK;
}
fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg)) {
+ warn("Received Feature Abort for Request ARC Termination (but the message was recognized).");
+ return PRESUMED_OK;
+ }
cec_msg_init(&msg, me, la);
cec_msg_report_arc_terminated(&msg);
@@ -322,6 +332,8 @@ static int sac_request_sad_probe(struct node *node, unsigned me, unsigned la, bo
fail_on_test(timed_out(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
node->remote[la].has_sad = true;
return 0;
@@ -401,7 +413,7 @@ static int sac_sad_req_multiple(struct node *node, unsigned me, unsigned la, boo
cec_msg_request_short_audio_descriptor(&msg, true, 4, audio_format_id, audio_format_code);
fail_on_test(!transmit_timeout(node, &msg));
fail_on_test(timed_out(&msg));
- fail_on_test(unrecognized_op(&msg));
+ fail_on_test(cec_msg_status_is_abort(&msg));
return 0;
}
@@ -448,7 +460,9 @@ static int sac_system_audio_mode_status(struct node *node, unsigned me, unsigned
is_tv(la, node->remote[la].prim_type) && unrecognized_op(&msg));
if (unrecognized_op(&msg) && !node->remote[la].has_set_sys_audio_mode)
return NOTSUPPORTED;
- fail_on_test(cec_msg_status_is_abort(&msg));
+ fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -482,6 +496,8 @@ static int sac_system_audio_mode_req_on(struct node *node, unsigned me, unsigned
cec_has_audiosystem(1 << la) && unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
node->remote[la].has_sys_audio_mode_req = true;
cec_ops_set_system_audio_mode(&msg, &status);
fail_on_test(status != CEC_OP_SYS_AUD_STATUS_ON);
@@ -506,7 +522,9 @@ static int sac_give_system_audio_mode_status(struct node *node, unsigned me, uns
cec_has_audiosystem(1 << la) && unrecognized_op(&msg));
if (unrecognized_op(&msg) && !node->remote[la].has_sys_audio_mode_req)
return NOTSUPPORTED;
- fail_on_test(timed_out_or_abort(&msg));
+ fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
cec_ops_system_audio_mode_status(&msg, &system_audio_status);
fail_on_test(system_audio_status != CEC_OP_SYS_AUD_STATUS_ON);
@@ -527,6 +545,8 @@ static int sac_give_audio_status(struct node *node, unsigned me, unsigned la, bo
cec_has_audiosystem(1 << la) && unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
cec_ops_report_audio_status(&msg, &node->remote[la].mute, &node->remote[la].volume);
fail_on_test(node->remote[la].volume > 100);
@@ -576,6 +596,8 @@ static int sac_util_send_user_control_press(struct node *node, unsigned me, unsi
if (unrecognized_op(&msg) && !node->remote[la].has_sys_audio_mode_req)
return NOTSUPPORTED;
fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
if (got_response) {
cec_ops_report_audio_status(&msg, &node->remote[la].mute, &node->remote[la].volume);
return 0;
@@ -642,6 +664,8 @@ static int sac_user_control_release(struct node *node, unsigned me, unsigned la,
if (unrecognized_op(&msg) && !node->remote[la].has_sys_audio_mode_req)
return NOTSUPPORTED;
fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return PRESUMED_OK;
}
@@ -662,6 +686,8 @@ static int sac_system_audio_mode_req_off(struct node *node, unsigned me, unsigne
cec_has_audiosystem(1 << la) && unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
cec_ops_set_system_audio_mode(&msg, &status);
fail_on_test(status != CEC_OP_SYS_AUD_STATUS_OFF);
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
index b266fa3d..06ad1532 100644
--- a/utils/cec-compliance/cec-test-power.cpp
+++ b/utils/cec-compliance/cec-test-power.cpp
@@ -78,7 +78,9 @@ static int power_status_probe(struct node *node, unsigned me, unsigned la, bool
cec_msg_give_device_power_status(&msg, true);
fail_on_test(!transmit_timeout(node, &msg));
fail_on_test(timed_out(&msg));
- fail_on_test(cec_msg_status_is_abort(&msg) && la != CEC_LOG_ADDR_UNREGISTERED);
+ fail_on_test(unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
__u8 power_status;
cec_ops_report_power_status(&msg, &power_status);
@@ -105,7 +107,9 @@ static int one_touch_play_image_view_on(struct node *node, unsigned me, unsigned
cec_msg_init(&msg, me, la);
cec_msg_image_view_on(&msg);
fail_on_test(!transmit_timeout(node, &msg));
- fail_on_test(is_tv(la, node->remote[la].prim_type) && cec_msg_status_is_abort(&msg));
+ fail_on_test(is_tv(la, node->remote[la].prim_type) && unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
fail_on_test(interactive && !question("Did the TV turn on?"));
node->remote[la].has_image_view_on = true;
@@ -124,7 +128,9 @@ static int one_touch_play_text_view_on(struct node *node, unsigned me, unsigned
cec_msg_init(&msg, me, la);
cec_msg_text_view_on(&msg);
fail_on_test(!transmit_timeout(node, &msg));
- fail_on_test(is_tv(la, node->remote[la].prim_type) && cec_msg_status_is_abort(&msg));
+ fail_on_test(is_tv(la, node->remote[la].prim_type) && unrecognized_op(&msg));
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
fail_on_test(interactive && !question("Did the TV turn on?"));
node->remote[la].has_text_view_on = true;
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 69b9a876..7596c678 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -590,6 +590,8 @@ static int deck_ctl_give_status(struct node *node, unsigned me, unsigned la, boo
!node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -603,6 +605,8 @@ static int deck_ctl_deck_status(struct node *node, unsigned me, unsigned la, boo
fail_on_test(!transmit_timeout(node, &msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -620,6 +624,8 @@ static int deck_ctl_deck_ctl(struct node *node, unsigned me, unsigned la, bool i
!node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return PRESUMED_OK;
}
@@ -637,6 +643,8 @@ static int deck_ctl_play(struct node *node, unsigned me, unsigned la, bool inter
!node->remote[la].has_deck_ctl && !unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return PRESUMED_OK;
}
@@ -671,8 +679,10 @@ static int tuner_ctl_give_status(struct node *node, unsigned me, unsigned la, bo
cec_msg_give_tuner_device_status(&msg, true, CEC_OP_STATUS_REQ_ONCE);
fail_on_test(!transmit_timeout(node, &msg));
fail_on_test(timed_out(&msg));
- if (cec_msg_status_is_abort(&msg))
+ if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -767,6 +777,8 @@ static int tuner_ctl_tuner_dev_status(struct node *node, unsigned me, unsigned l
fail_on_test(!transmit_timeout(node, &msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -836,6 +848,8 @@ static int one_touch_rec_tv_screen(struct node *node, unsigned me, unsigned la,
!node->remote[la].has_rec_tv && !unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -857,6 +871,8 @@ static int one_touch_rec_on(struct node *node, unsigned me, unsigned la, bool in
fail_on_test(cec_has_record(1 << la) && unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}
@@ -871,6 +887,8 @@ static int one_touch_rec_off(struct node *node, unsigned me, unsigned la, bool i
fail_on_test(cec_has_record(1 << la) && unrecognized_op(&msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
if (timed_out(&msg))
return PRESUMED_OK;
@@ -887,6 +905,8 @@ static int one_touch_rec_status(struct node *node, unsigned me, unsigned la, boo
fail_on_test(!transmit_timeout(node, &msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
+ if (cec_msg_status_is_abort(&msg))
+ return PRESUMED_OK;
return 0;
}

Privacy Policy