From 277d149f4d5e5ccd3b6a2cf666db75d83bf77539 Mon Sep 17 00:00:00 2001 From: Cyril Jourdan Date: Thu, 18 Apr 2013 14:40:34 +0200 Subject: cesar/ce/rx/bl/fsm: check SRC to generate sound events, closes #3886 With this modification, sound frames with non interval specific SRCs are directed to global FSM. When in INTERVALS state, this causes a complete CE restart, what avoid sync issues between transmitter and receiver. --- cesar/ce/rx/bitloading/test/src/test_intervals.c | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'cesar/ce/rx/bitloading/test/src') diff --git a/cesar/ce/rx/bitloading/test/src/test_intervals.c b/cesar/ce/rx/bitloading/test/src/test_intervals.c index c319e2688e..4fb5f23f4e 100644 --- a/cesar/ce/rx/bitloading/test/src/test_intervals.c +++ b/cesar/ce/rx/bitloading/test/src/test_intervals.c @@ -228,6 +228,7 @@ test_suite_ce_rx_bl_intervals_measure_to_event_master_test ( int sound, bool intervals, bool mea_interval, + bool src_interval, ce_rx_bl_fsm_event_type_t *event, int *fsm_id) { @@ -255,6 +256,10 @@ test_suite_ce_rx_bl_intervals_measure_to_event_master_test ( /* Configure measure. */ measure.rx_params.sound = sound; measure.rx_params.sound_complete = 0; + if (src_interval) + measure.rx_params.sound_src = TONEMAP_SRC_INTERVAL_UNAVAILABLE; + else + measure.rx_params.sound_src = TONEMAP_SRC_INITIAL; measure.rx_params.preamble_ntb = 0; measure.rx_params.beacon_period_start_ntb = 0; /* Measure is global. */ @@ -288,6 +293,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) false, /* Measure is positioned on an interval ? */ false, + /* SRC is interval specific ? */ + false, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_sound); test_fail_if (fsm_id != -1); @@ -303,6 +310,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) false, /* Measure is positioned on an interval ? */ true, + /* SRC is interval specific ? */ + false, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_sound); test_fail_if (fsm_id != -1); @@ -318,6 +327,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) true, /* Measure is positioned on an interval ? */ false, + /* SRC is interval specific ? */ + true, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_sound); test_fail_if (fsm_id != -1); @@ -333,10 +344,29 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) true, /* Measure is positioned on an interval ? */ true, + /* SRC is interval specific ? */ + true, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_interval_sound); test_fail_if (fsm_id != 0); } test_end; + test_begin (t, "Measure to event conversion, sound, intervals, " + "small measure, SRC is global") + { + test_suite_ce_rx_bl_intervals_measure_to_event_master_test ( + t, + /* Sound ? */ + 1, + /* RX contains intervals ? */ + true, + /* Measure is positioned on an interval ? */ + true, + /* SRC is interval specific ? */ + false, + &out, &fsm_id); + test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_sound); + test_fail_if (fsm_id != -1); + } test_end; test_begin (t, "Measure to event conversion, not sound, no interval, " "big measure") { @@ -348,6 +378,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) false, /* Measure is positioned on an interval ? */ false, + /* SRC is interval specific ? */ + false, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_data); test_fail_if (fsm_id != -1); @@ -363,6 +395,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) false, /* Measure is positioned on an interval ? */ true, + /* SRC is interval specific ? */ + false, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_data); test_fail_if (fsm_id != -1); @@ -378,6 +412,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) true, /* Measure is positioned on an interval ? */ false, + /* SRC is interval specific ? */ + true, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_data); test_fail_if (fsm_id != -1); @@ -393,6 +429,8 @@ test_suite_ce_rx_bl_intervals_measure_to_event (test_t t) true, /* Measure is positioned on an interval ? */ true, + /* SRC is interval specific ? */ + true, &out, &fsm_id); test_fail_if (out != CE_RX_BL_FSM_EVENT_TYPE_interval_data); test_fail_if (fsm_id != 0); -- cgit v1.2.3