static void run_tal_reset_test(const struct test_case *test) { retval_t status; status = tal_reset(true); test_assert_true(test, status == MAC_SUCCESS, "AVR2025_MAC - TAL Reset request failed"); }
void pulse_cw_transmission(void) { uint16_t channel; /*Start the Pulse CW Trx after the confirmation is sent*/ if(node_info.main_state == PER_TEST_RECEPTOR && !cw_ack_sent) { remote_pulse_cw_start = true; usr_cont_pulse_tx_confirm(MAC_SUCCESS); return; } remote_pulse_cw_start = false; cw_ack_sent = false; op_mode = CONTINUOUS_TX_MODE; tal_pib_get(phyCurrentChannel,(uint8_t *)&channel); /* Save all user settings before continuous tx */ save_all_settings(); tal_reset(false); #if (TAL_TYPE == AT86RF233) /* Set the frequency back to already set value after tal_reset */ if (CC_BAND_0 != cc_band_ct) { tal_set_frequency_regs(cc_band_ct, cc_number_ct); } #endif /* End of (TAL_TYPE == AT86RF233) */ /* Start the Continuous Wave transmission */ tfa_continuous_tx_start(CW_MODE, false); /* Start the timer to stop the Continuous transmission */ sw_timer_start(T_APP_TIMER, PULSE_CW_TX_TIME_IN_MICRO_SEC, SW_TIMEOUT_RELATIVE, (FUNC_PTR)stop_pulse_cb, NULL); }
/* * @brief Internal MAC reset function * * This function resets the MAC variables, stops all running timers and * initializes the PIBs. * * @param init_pib Boolean indicates whether PIB attributes shall be * initialized or not. * * @return Success or failure status */ static uint8_t mac_reset(uint8_t init_pib) { uint8_t status = MAC_DISABLE_TRX_FAILURE; /* * Transceiver is going to stop giving out clock for some time * so change to internal clock */ pal_timer_source_select(TMR_CLK_SRC_DURING_TRX_SLEEP); /* Reset TAL */ status = tal_reset(init_pib); /* Transceiver is now giving out clock, switch back to external clock */ pal_timer_source_select(TMR_CLK_SRC_DURING_TRX_AWAKE); mac_soft_reset(init_pib); return status; }
void start_cw_transmission(uint8_t tx_mode,uint16_t tmr_val) { /* If the test is initiated on the receptor node, First send the * Start confirmation back to the host. * Once this is done the test could be started. * The cw_ack_sent flag is used for this purpose */ if(node_info.main_state == PER_TEST_RECEPTOR && !cw_ack_sent) { /* timer value should not exceed 3600 seconds */ if((tx_mode !=CW_MODE && tx_mode != PRBS_MODE) || (3600 < tmr_val)) { usr_cont_wave_tx_confirm(INVALID_ARGUMENT, 0x01, tx_mode); return; } else { /* Send Set confirmation with status SUCCESS and start CW trx on * successful transmission of the Confirmation message*/ usr_cont_wave_tx_confirm(MAC_SUCCESS, START_CWT, tx_mode); remote_cw_start = true; cw_start_mode = tx_mode; cw_tmr_val = tmr_val; return; } } else if(node_info.main_state == PER_TEST_INITIATOR || (node_info.main_state == SINGLE_NODE_TESTS) || ((node_info.main_state == PER_TEST_RECEPTOR) && cw_ack_sent)) { /* Save all user settings before continuous tx */ save_all_settings(); /* Added to ensure CW transmission happen in every attempt */ tal_reset(false); #if (ANTENNA_DIVERSITY == 1) if (ANT_DIV_DISABLE == ant_div_before_ct) { tal_ant_div_config(ANT_DIVERSITY_DISABLE, ant_sel_before_ct); } #endif if((node_info.main_state == PER_TEST_RECEPTOR) && 1 <= tmr_val ) { sw_timer_start(CW_TX_TIMER, (uint32_t)tmr_val * 1E6, SW_TIMEOUT_RELATIVE, (FUNC_PTR)stop_cw_transmission, (void *)&tx_mode); } switch (tx_mode) { case CW_MODE: /* CW mode*/ { /* In CW_MODE the parameter random_content is obsolete. */ tfa_continuous_tx_start(CW_MODE, false); } break; case PRBS_MODE: /* PRBS mode*/ { /* Start PRBS_MODE mode using random content. */ tfa_continuous_tx_start(PRBS_MODE, true); } break; default: { usr_cont_wave_tx_confirm(INVALID_ARGUMENT, 0x01, tx_mode); return; } } op_mode = CONTINUOUS_TX_MODE; if(node_info.main_state == PER_TEST_RECEPTOR ) { cw_ack_sent=false; } else { /* Send Set confirmation with status SUCCESS */ usr_cont_wave_tx_confirm(MAC_SUCCESS, START_CWT, tx_mode); } } }
/* * \brief Stops continuous transmission */ void tfa_continuous_tx_stop(void) { tal_reset(false); }
/* * \brief Stops continuous transmission */ void tfa_continuous_tx_stop(void) { TST_PORT_LOW(); tal_reset(false); }