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_RATE_IN_MICRO_SEC (50000) |
Functions | |
void | app_reset (void) |
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 (peer_info_rsp_t *data) |
Function used to get the board details of peer node. 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 (void *parameter) |
Initialize the application in PER Measurement mode as Receptor. More... | |
void | per_mode_receptor_rx_cb (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 (void) |
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 (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... | |
void | pkt_stream_gap_timer (void *parameter) |
Timer used in Packet Streaming Mode to add gap in between consecutive frames. More... | |
float | reverse_float (const float float_val) |
The reverse_float is used for reversing a float variable for supporting BIG ENDIAN systems. More... | |
static void | send_peer_info_rsp (void) |
Function used to send peer_info_rsp command. More... | |
static bool | send_range_test_marker_cmd (void) |
Function to send the range test marker command to the initiator node. More... | |
static void | send_range_test_rsp (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... | |
bool | send_remote_reply_cmd (uint8_t *serial_buf, uint8_t len) |
This function is used to send a remote test response command back to the initiator. More... | |
static void | send_result_rsp (void) |
Function used to send PER test result. More... | |
static void | set_paramter_on_recptor_node (app_payload_t *msg) |
Extract the received command frame and set the parameters like channel, tx power etc on Receptor node. More... | |
void | stop_pkt_streaming (void *parameter) |
This function is called to abort the packet streaming mode in progress. More... | |
Variables | |
bool | trx_config_params_t::ack_request |
static uint32_t | aver_lqi |
static uint32_t | aver_rssi |
uint16_t | trx_config_params_t::channel |
uint8_t | ed_scan_result_t::channel_no |
uint8_t | trx_config_params_t::channel_page |
bool | trx_config_params_t::csma_enabled |
float | trx_config_params_t::ism_frequency |
static uint8_t | marker_seq_num = 0 |
static uint32_t | number_rx_frames |
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 = false |
static uint8_t | remote_cmd_len |
static uint8_t * | remote_cmd_ptr |
static bool | remote_cmd_rx = false |
bool | trx_config_params_t::retry_enabled |
bool | trx_config_params_t::rpc_enable |
static uint8_t | seq_num_receptor |
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_RATE_IN_MICRO_SEC (50000) |
void app_reset | ( | void | ) |
References INIT, NULL, 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, CONTINUOUS_RX_ON_MODE, 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, PER_REMOTE_CONFIG_MODE, PKT_STREAMING_MODE, reverse_float(), peer_info_rsp_t::soc_mcu_name, tal_pib, TRANSCEIVER_NAME, and peer_info_rsp_t::trx_name.
Referenced by send_peer_info_rsp().
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, NULL, 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, NULL, SW_TIMEOUT_RELATIVE, sw_timer_start(), and sw_timer_stop().
Referenced by per_mode_receptor_task(), and send_range_test_marker_rsp().
void per_mode_receptor_init | ( | void * | parameter | ) |
Initialize the application in PER Measurement mode as Receptor.
parameter | Pointer to the paramter to be carried, if any. |
References config_per_test_parameters(), PA_EXT_ENABLE, phyTransmitPower, seq_num_receptor, SR_PA_EXT_EN, tal_pib_set(), and TAL_TRANSMIT_POWER_DEFAULT.
void per_mode_receptor_rx_cb | ( | 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, ANT_CTRL_1, ANT_CTRL_2, ANT_DIVERSITY_DISABLE, ANT_DIVERSITY_ENABLE, div_set_req_t::ant_sel, ANTENNA_DEFAULT, app_led_event(), app_reset_cb(), APP_TIMER_TO_TX, aver_lqi, aver_rssi, CCPU_ENDIAN_TO_LE32, app_payload_t::cmd_id, CMD_ID_LEN, config_per_test_parameters(), general_pkt_t::crc_set_req_data, curr_trx_config_params, DELAY_BEFORE_APP_RESET_IN_MICRO_SEC, DISCONNECT_NODE, general_pkt_t::div_set_req_data, ED_VAL_LEN, FCS_LEN, range_tx_t::frame_count, FRAME_OVERHEAD, FUNC_PTR, IDENTIFY_NODE, LED_BLINK_RATE_IN_MICRO_SEC, led_blinker_timer_handler_cb(), LED_EVENT_PEER_SEARCH_DONE, LED_EVENT_RX_FRAME, LED_TOGGLE_COUNT_FOR_PER, LENGTH_FIELD_LEN, LQI_LEN, macShortAddress, marker_rsp_timer_handler_cb(), marker_seq_num, MESSAGE_ID_POS, frame_info_tag::mpdu, NULL, number_rx_frames, app_payload_t::payload, PEER_INFO_REQ, PER_TEST_PKT, PER_TEST_START_PKT, 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, remote_cmd_len, REMOTE_CMD_MASK, remote_cmd_ptr, remote_cmd_rx, remote_test_req_t::remote_serial_data, REMOTE_TEST_CMD, general_pkt_t::remote_test_req_data, RESULT_REQ, rx_on_mode, RX_ON_REQ, send_peer_info_rsp(), send_range_test_rsp(), send_result_rsp(), app_payload_t::seq_num, SEQ_NUM_LEN, SET_DEFAULT_REQ, SET_PARAM, set_paramter_on_recptor_node(), SHORT_ADDR_LEN, div_set_req_t::status, crc_set_req_t::status, SW_TIMEOUT_RELATIVE, sw_timer_start(), T_APP_TIMER, tal_get_rssi_base_val(), and tal_pib_get().
void per_mode_receptor_task | ( | void | ) |
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, convert_ota_serial_frame_rx(), cw_start_mode, CW_TX_TIMER, FUNC_PTR, LED_BLINK_RATE_IN_MICRO_SEC, marker_tx_timer_handler_cb(), NO_CSMA_NO_IFS, node_info, NULL, pkt_stream_gap_time, pkt_stream_gap_timer(), pkt_stream_stop, range_test_in_progress, rdy_to_tx, remote_cmd_len, remote_cmd_ptr, remote_cmd_rx, remote_cw_start, send_range_test_marker_cmd(), stop_pkt_streaming(), stream_pkt, SW_TIMEOUT_RELATIVE, sw_timer_start(), sw_timer_stop(), T_APP_TIMER, tal_tx_frame(), and node_ib_t::transmitting.
void per_mode_receptor_tx_done_cb | ( | 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 CMD_RX_ON, cw_ack_sent, cw_start_mode, cw_tmr_val, node_info, remote_cw_start, remote_pulse_cw_start, rx_on_mode, set_trx_state(), and node_ib_t::transmitting.
void pkt_stream_gap_timer | ( | void * | parameter | ) |
Timer used in Packet Streaming Mode to add gap in between consecutive frames.
References rdy_to_tx.
Referenced by per_mode_initiator_task(), per_mode_receptor_task(), and pktstream_test().
float reverse_float | ( | const float | float_val | ) |
The reverse_float is used for reversing a float variable for supporting BIG ENDIAN systems.
float_val | Float variable to be reversed |
Referenced by get_board_details(), get_node_info(), get_sensor_data(), per_mode_initiator_rx_cb(), and start_ed_scan().
|
static |
Function used to send peer_info_rsp command.
References app_payload_t::cmd_id, data, FCF_SHORT_ADDR, get_node_info(), node_info, app_payload_t::payload, PEER_INFO_RSP, node_ib_t::peer_short_addr, app_payload_t::seq_num, seq_num_receptor, and transmit_frame().
Referenced by per_mode_receptor_rx_cb().
|
static |
Function to send the range test marker command to the initiator node.
References 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, seq_num_receptor, and transmit_frame().
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_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, node_ib_t::peer_short_addr, RANGE_TEST_RSP, seq_num, app_payload_t::seq_num, seq_num_receptor, and transmit_frame().
Referenced by per_mode_receptor_rx_cb().
bool send_remote_reply_cmd | ( | uint8_t * | serial_buf, |
uint8_t | len | ||
) |
This function is used to send a remote test response command back to the initiator.
This function is used to send a remote test repsonse command back to the initiator.
References app_payload_t::cmd_id, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, app_payload_t::payload, node_ib_t::peer_short_addr, REMOTE_MSG_BUF_SIZE, remote_test_req_t::remote_serial_data, REMOTE_TEST_REPLY_CMD, general_pkt_t::remote_test_req_data, app_payload_t::seq_num, seq_num_receptor, and transmit_frame().
Referenced by serial_data_handler().
|
static |
Function used to send PER test result.
References aver_lqi, aver_rssi, CCPU_ENDIAN_TO_LE32, app_payload_t::cmd_id, data, FCF_SHORT_ADDR, result_rsp_t::frames_with_wrong_crc, result_rsp_t::lqi_avrg_rx, node_info, result_rsp_t::num_of_frames_rx, number_rx_frames, app_payload_t::payload, node_ib_t::peer_short_addr, RESULT_RSP, result_rsp_t::rssi_avrg_rx, app_payload_t::seq_num, seq_num_receptor, and transmit_frame().
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 CC_BAND_0, CC_BAND_8, CC_BAND_9, CC_NUMBER_0, CHANNEL, trx_config_params_t::channel, CHANNEL_PAGE, trx_config_params_t::channel_page, CONV_DBM_TO_phyTransmitPower, curr_trx_config_params, DISABLE_ALL_RPC_MODES, FREQ_BAND_08, FREQ_BAND_09, MAC_SUCCESS, MIN_TX_PWR_REG_VAL, set_parm_req_t::param_type, set_parm_req_t::param_value, app_payload_t::payload, phyCurrentChannel, phyCurrentPage, phyTransmitPower, REGISTER_VALUE, RG_TRX_RPC, general_pkt_t::set_parm_req_data, tal_calculate_frequency(), tal_get_curr_trx_config(), tal_pib_get(), tal_pib_set(), tal_rpc_mode_config(), tal_set_frequency_regs(), tal_trx_reg_read(), tal_trx_reg_write(), TX_POWER_DBM, trx_config_params_t::tx_power_dbm, and TX_PWR.
Referenced by per_mode_receptor_rx_cb().
void stop_pkt_streaming | ( | void * | parameter | ) |
This function is called to abort the packet streaming mode in progress.
This function is called to abort the packet streaming mode in progress.
References CW_TX_TIMER, FUNC_PTR, LED_BLINK_RATE_IN_MICRO_SEC, led_blinker_timer_handler_cb(), MAC_SUCCESS, node_ib_t::main_state, node_info, NULL, PER_TEST_RECEPTOR, pkt_stream_stop, SW_TIMEOUT_RELATIVE, sw_timer_is_running(), sw_timer_start(), sw_timer_stop(), T_APP_TIMER, and usr_pkt_stream_confirm().
Referenced by per_mode_receptor_task(), and pktstream_test().
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_initiator_rx_cb(), 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 |
bool trx_config_params_t::csma_enabled |
float trx_config_params_t::ism_frequency |
|
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().
|
static |
Referenced by per_mode_receptor_rx_cb(), and per_mode_receptor_task().
|
static |
Referenced by per_mode_receptor_rx_cb(), and per_mode_receptor_task().
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 |
uint8_t trx_config_params_t::trx_state |
int8_t trx_config_params_t::tx_power_dbm |