This module handles the functionalities of the receptor in PER mode.
Macros | |
#define | DELAY_BEFORE_APP_RESET_IN_MICRO_SEC (5000) |
#define | LED_BLINK_COUNT_FOR_BUTTON_PRESS (10) |
#define | LED_BLINK_COUNT_FOR_IDENTIFY (20) |
Functions | |
void | app_reset (trx_id_t trx) |
static void | app_reset_cb (void *parameter) |
Timer Callback function if disconnect command is received on air by a node in reflector configuration.This is used to do a software reset on the reflector side. More... | |
static void | get_node_info (trx_id_t trx, peer_info_rsp_t *data) |
Function used to get the board details of peer node. More... | |
static void | identify_timer_handler_cb (void *parameter) |
Timer Callback function if identify command is received on air by a node in reflector configuration. More... | |
void | marker_rsp_timer_handler_cb (void *parameter) |
Timer Callback function if marker command is received on air This is used to blink the LED and thus identify that the marker frame is received. More... | |
void | marker_tx_timer_handler_cb (void *parameter) |
Timer Callback function if marker response command is transmitted on air This is used to blink the LED and thus identify that the transmission is done. More... | |
void | per_mode_receptor_init (trx_id_t trx, void *parameter) |
Initialize the application in PER Measurement mode as Receptor. More... | |
void | per_mode_receptor_rx_cb (trx_id_t trx, frame_info_t *frame) |
Callback that is called if data has been received by trx in the PER_TEST_RECEPTOR state This call back is used when the node is operating as PER Measurement mode Receptor. More... | |
void | per_mode_receptor_task (trx_id_t trx) |
The application task when the node is in PER_TEST_RECEPTOR state i.e.PER Measurement mode as Receptor. More... | |
void | per_mode_receptor_tx_done_cb (trx_id_t trx, retval_t status, frame_info_t *frame) |
Callback that is called once tx is done in PER_TEST_RECEPTOR state This call back is used when the node is operating as PER Measurement mode Receptor. More... | |
static void | send_crc_status_rsp (trx_id_t trx) |
Function used to send crc settings on remote node to host node. More... | |
static void | send_peer_info_rsp (trx_id_t trx) |
Function used to send peer_info_rsp command. More... | |
static bool | send_range_test_marker_cmd (trx_id_t trx) |
Function to send the range test marker command to the initiator node. More... | |
static void | send_range_test_rsp (trx_id_t trx, uint8_t seq_num, uint32_t frame_count, int8_t ed, uint8_t lqi) |
Function used to send response to the received range test packet. More... | |
static void | send_result_rsp (trx_id_t trx) |
Function used to send PER test result. More... | |
static void | set_default_configuration_peer_node (trx_id_t trx) |
Function used to set default configurations on peer node on reception of set_default req. More... | |
static void | set_paramter_on_recptor_node (trx_id_t trx, app_payload_t *msg) |
Extract the received command frame and set the parameters like channel, tx power etc on Receptor node. More... | |
Variables | |
bool | trx_config_params_t::ack_request |
static uint32_t | aver_lqi [NUM_TRX] |
static uint32_t | aver_rssi [NUM_TRX] |
uint16_t | trx_config_params_t::channel |
uint8_t | ed_scan_result_t::channel_no |
uint8_t | trx_config_params_t::channel_page |
int | char_received |
bool | trx_config_params_t::csma_enabled |
uint32_t | frames_with_wrong_crc [NUM_TRX] |
float | trx_config_params_t::ism_frequency |
bool | manual_crc [NUM_TRX] = {false, false} |
static uint8_t | marker_seq_num [NUM_TRX] = {0, 0} |
static uint32_t | number_rx_frames [NUM_TRX] |
uint32_t | trx_config_params_t::number_test_frames |
int8_t | ed_scan_result_t::p_in |
uint16_t | trx_config_params_t::phy_frame_length |
static bool | range_test_in_progress [NUM_TRX] = {false, false} |
bool | trx_config_params_t::retry_enabled |
bool | trx_config_params_t::rpc_enable |
static uint8_t | seq_num_receptor [NUM_TRX] |
sun_phy_t | trx_config_params_t::sun_phy_page |
uint8_t | trx_config_params_t::trx_state |
int8_t | trx_config_params_t::tx_power_dbm |
#define DELAY_BEFORE_APP_RESET_IN_MICRO_SEC (5000) |
Referenced by per_mode_receptor_rx_cb().
#define LED_BLINK_COUNT_FOR_BUTTON_PRESS (10) |
Referenced by marker_rsp_timer_handler_cb(), and marker_tx_timer_handler_cb().
#define LED_BLINK_COUNT_FOR_IDENTIFY (20) |
Referenced by identify_timer_handler_cb().
void app_reset | ( | trx_id_t | trx | ) |
References init_after_disconnect(), set_main_state(), and WAIT_FOR_EVENT.
Referenced by app_reset_cb(), disconnect_peer_node(), per_mode_initiator_tx_done_cb(), and wait_for_reply_timer_handler_cb().
|
static |
Timer Callback function if disconnect command is received on air by a node in reflector configuration.This is used to do a software reset on the reflector side.
parameter | pass parameters to timer handler |
References app_reset().
Referenced by per_mode_receptor_rx_cb().
|
static |
Function used to get the board details of peer node.
pointer | to the peer_info_rsp_t structure |
References BOARD_NAME, peer_info_rsp_t::board_name, CCPU_ENDIAN_TO_LE32, peer_info_rsp_t::feature_mask, FIRMWARE_VERSION, peer_info_rsp_t::fw_version, IC_TYPE, peer_info_rsp_t::ic_type, peer_info_rsp_t::mac_address, MCU_SOC_NAME, MULTI_CHANNEL_SELECT, PER_RANGE_TEST_MODE, reverse_float(), RF09, peer_info_rsp_t::soc_mcu_name, tal_pib, and peer_info_rsp_t::trx_name.
Referenced by send_peer_info_rsp().
|
static |
Timer Callback function if identify command is received on air by a node in reflector configuration.
This is used to blink the LED and thus identify itself
parameter | pass parameters to timer handler |
References app_led_event(), APP_TIMER_TO_TX, FUNC_PTR, LED_BLINK_COUNT_FOR_IDENTIFY, LED_BLINK_RATE_IN_MICRO_SEC, LED_EVENT_ALL_OFF, LED_EVENT_ALL_ON, LED_EVENT_PEER_SEARCH_DONE, SW_TIMEOUT_RELATIVE, sw_timer_start(), and sw_timer_stop().
Referenced by per_mode_receptor_rx_cb().
void marker_rsp_timer_handler_cb | ( | void * | parameter | ) |
Timer Callback function if marker command is received on air This is used to blink the LED and thus identify that the marker frame is received.
parameter | pass parameters to timer handler |
References app_led_event(), FUNC_PTR, LED_BLINK_COUNT_FOR_BUTTON_PRESS, LED_BLINK_RATE_IN_MICRO_SEC, LED_EVENT_PEER_SEARCH_DONE, LED_Off, LED_On, RX_LED, SW_TIMEOUT_RELATIVE, sw_timer_start(), sw_timer_stop(), and T_APP_TIMER.
Referenced by per_mode_initiator_rx_cb(), and per_mode_receptor_rx_cb().
void marker_tx_timer_handler_cb | ( | void * | parameter | ) |
Timer Callback function if marker response command is transmitted on air This is used to blink the LED and thus identify that the transmission is done.
parameter | pass parameters to timer handler |
References app_led_event(), APP_TIMER_TO_TX, FUNC_PTR, LED_BLINK_COUNT_FOR_BUTTON_PRESS, LED_BLINK_RATE_IN_MICRO_SEC, LED_EVENT_PEER_SEARCH_DONE, LED_Off, LED_On, SW_TIMEOUT_RELATIVE, sw_timer_start(), sw_timer_stop(), and TX_LED.
Referenced by per_mode_receptor_task(), and send_range_test_marker_rsp().
void per_mode_receptor_init | ( | trx_id_t | trx, |
void * | parameter | ||
) |
Initialize the application in PER Measurement mode as Receptor.
parameter | Pointer to the paramter to be carried, if any. |
References phyTransmitPower, seq_num_receptor, tal_pib_set(), and TAL_TRANSMIT_POWER_DEFAULT.
void per_mode_receptor_rx_cb | ( | trx_id_t | trx, |
frame_info_t * | frame | ||
) |
Callback that is called if data has been received by trx in the PER_TEST_RECEPTOR state This call back is used when the node is operating as PER Measurement mode Receptor.
frame | Pointer to received frame |
References AACK_PROM_DISABLE, AACK_PROM_ENABLE, app_led_event(), app_reset_cb(), APP_TIMER_TO_TX, aver_lqi, aver_rssi, CCPU_ENDIAN_TO_LE32, phy_tag::ch_spacing, app_payload_t::cmd_id, crc_check_ok(), general_pkt_t::crc_set_req_data, DELAY_BEFORE_APP_RESET_IN_MICRO_SEC, DISCONNECT_NODE, range_tx_t::frame_count, FRAME_OVERHEAD, frames_with_wrong_crc, phy_tag::freq_band, phy_tag::freq_f0, FSK, FUNC_PTR, IDENTIFY_NODE, identify_timer_handler_cb(), LED_BLINK_RATE_IN_MICRO_SEC, LED_EVENT_PEER_SEARCH_DONE, LED_EVENT_RX_FRAME, LED_TOGGLE_COUNT_FOR_PER, LEG_OQPSK, frame_info_tag::len_no_crc, MAC_SUCCESS, macShortAddress, manual_crc, marker_rsp_timer_handler_cb(), marker_seq_num, phy_tag::modulation, frame_info_tag::mpdu, NUM_TRX, number_rx_frames, OFDM, OQPSK, OQPSK_DATA_RATE_250, app_payload_t::payload, PEER_INFO_REQ, PER_TEST_PKT, PER_TEST_START_PKT, phy_tag::phy_mode, phyFSKFECEnabled, phyHighRateEnabled, phyOFDMMCS, phyOQPSKRateMode, phySetting, PL_POS_DST_ADDR_START, PL_POS_SEQ_NUM, range_test_in_progress, RANGE_TEST_MARKER_RSP, RANGE_TEST_PKT, RANGE_TEST_START_PKT, RANGE_TEST_STOP_PKT, general_pkt_t::range_tx_data, RESULT_REQ, send_crc_status_rsp(), send_peer_info_rsp(), send_range_test_rsp(), send_result_rsp(), app_payload_t::seq_num, set_default_configuration_peer_node(), SET_DEFAULT_REQ, SET_PARAM, set_paramter_on_recptor_node(), SET_SUN_PAGE, SHORT_ADDR_LEN, crc_set_req_t::status, SW_TIMEOUT_RELATIVE, sw_timer_start(), T_APP_TIMER, tal_pib, tal_pib_get(), tal_pib_set(), and tal_rxaack_prom_mode_ctrl().
void per_mode_receptor_task | ( | trx_id_t | trx | ) |
The application task when the node is in PER_TEST_RECEPTOR state i.e.PER Measurement mode as Receptor.
References app_debounce_button(), APP_TIMER_TO_TX, FUNC_PTR, LED_BLINK_RATE_IN_MICRO_SEC, marker_tx_timer_handler_cb(), range_test_in_progress, RF09, RF24, send_range_test_marker_cmd(), SW_TIMEOUT_RELATIVE, and sw_timer_start().
void per_mode_receptor_tx_done_cb | ( | trx_id_t | trx, |
retval_t | status, | ||
frame_info_t * | frame | ||
) |
Callback that is called once tx is done in PER_TEST_RECEPTOR state This call back is used when the node is operating as PER Measurement mode Receptor.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References node_info, and node_ib_t::transmitting.
|
static |
Function used to send crc settings on remote node to host node.
References app_transmit_frame(), app_payload_t::cmd_id, data, FCF_SHORT_ADDR, node_info, app_payload_t::payload, app_payload_t::seq_num, seq_num_receptor, crc_stat_rsp_t::status, and tal_get_curr_trx_config().
Referenced by per_mode_receptor_rx_cb().
|
static |
Function used to send peer_info_rsp command.
References app_transmit_frame(), app_payload_t::cmd_id, data, FCF_SHORT_ADDR, get_node_info(), node_info, app_payload_t::payload, PEER_INFO_RSP, app_payload_t::seq_num, and seq_num_receptor.
Referenced by per_mode_receptor_rx_cb().
Function to send the range test marker command to the initiator node.
References app_transmit_frame(), result_req_t::cmd, app_payload_t::cmd_id, data, DUMMY_PAYLOAD, FCF_SHORT_ADDR, MAC_SUCCESS, marker_seq_num, node_info, app_payload_t::payload, node_ib_t::peer_short_addr, RANGE_TEST_MARKER_CMD, app_payload_t::seq_num, and seq_num_receptor.
Referenced by per_mode_receptor_task().
|
static |
Function used to send response to the received range test packet.
seq_num | sequence number of the range test packet received |
frame_count | Count of the received Range Test Packet |
ed | ED value of the received range test packet which has to be uploaded into the response payload |
lqi | LQI value of the received range test packet which has to be uploaded into the response payload |
References app_led_event(), app_transmit_frame(), app_payload_t::cmd_id, data, range_tx_t::ed, FCF_SHORT_ADDR, range_tx_t::frame_count, LED_EVENT_TX_FRAME, range_tx_t::lqi, node_info, app_payload_t::payload, RANGE_TEST_RSP, seq_num, app_payload_t::seq_num, and seq_num_receptor.
Referenced by per_mode_receptor_rx_cb().
|
static |
Function used to send PER test result.
References app_transmit_frame(), aver_lqi, aver_rssi, CCPU_ENDIAN_TO_LE32, app_payload_t::cmd_id, data, FCF_SHORT_ADDR, frames_with_wrong_crc, result_rsp_t::frames_with_wrong_crc, result_rsp_t::lqi_avrg_rx, manual_crc, node_info, result_rsp_t::num_of_frames_rx, number_rx_frames, app_payload_t::payload, RESULT_RSP, result_rsp_t::rssi_avrg_rx, app_payload_t::seq_num, and seq_num_receptor.
Referenced by per_mode_receptor_rx_cb().
|
static |
Function used to set default configurations on peer node on reception of set_default req.
References AACK_PROM_DISABLE, DEFAULT_CHANNEL_RF09, DEFAULT_CHANNEL_RF24, manual_crc, phyCurrentChannel, phyCurrentPage, phyTransmitPower, RF24, TAL_CURRENT_PAGE_DEFAULT_RF09, TAL_CURRENT_PAGE_DEFAULT_RF24, tal_pib_set(), tal_rxaack_prom_mode_ctrl(), and TAL_TRANSMIT_POWER_DEFAULT.
Referenced by per_mode_receptor_rx_cb().
|
static |
Extract the received command frame and set the parameters like channel, tx power etc on Receptor node.
pointer | to cmd payload |
References CHANNEL, CHANNEL_PAGE, MAC_SUCCESS, set_parm_req_t::param_type, set_parm_req_t::param_value, app_payload_t::payload, phyCurrentChannel, phyCurrentPage, phyTransmitPower, general_pkt_t::set_parm_req_data, tal_convert_reg_value_to_dBm(), tal_pib_set(), and TX_POWER_DBM.
Referenced by per_mode_receptor_rx_cb().
bool trx_config_params_t::ack_request |
|
static |
Referenced by per_mode_initiator_rx_cb(), per_mode_receptor_rx_cb(), and send_result_rsp().
|
static |
Referenced by per_mode_receptor_rx_cb(), and send_result_rsp().
uint16_t trx_config_params_t::channel |
uint8_t ed_scan_result_t::channel_no |
Referenced by per_mode_initiator_ed_end_cb(), and usr_ed_scan_end_indication().
uint8_t trx_config_params_t::channel_page |
int char_received |
Referenced by range_test_tx_off_task(), and range_test_tx_on_task().
bool trx_config_params_t::csma_enabled |
uint32_t frames_with_wrong_crc[NUM_TRX] |
Referenced by per_mode_initiator_rx_cb(), per_mode_receptor_rx_cb(), and send_result_rsp().
float trx_config_params_t::ism_frequency |
Referenced by per_mode_receptor_rx_cb(), send_result_rsp(), and set_default_configuration_peer_node().
|
static |
Referenced by per_mode_receptor_rx_cb(), send_range_test_marker_cmd(), and send_range_test_marker_rsp().
|
static |
Referenced by per_mode_initiator_rx_cb(), per_mode_receptor_rx_cb(), and send_result_rsp().
uint32_t trx_config_params_t::number_test_frames |
int8_t ed_scan_result_t::p_in |
Referenced by per_mode_initiator_ed_end_cb(), and usr_ed_scan_end_indication().
uint16_t trx_config_params_t::phy_frame_length |
Referenced by per_mode_receptor_rx_cb(), and per_mode_receptor_task().
bool trx_config_params_t::retry_enabled |
bool trx_config_params_t::rpc_enable |
|
static |
sun_phy_t trx_config_params_t::sun_phy_page |
Referenced by usr_get_current_config_confirm().
uint8_t trx_config_params_t::trx_state |
int8_t trx_config_params_t::tx_power_dbm |