Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

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)

static void app_reset_cb ( void *  parameter)
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.

Parameters
parameterpass parameters to timer handler

References app_reset(), and printf.

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.

Parameters
parameterpass 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.

Parameters
parameterpass 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.

Parameters
parameterPointer to the paramter to be carried, if any.

References config_per_test_parameters(), PA_EXT_ENABLE, phyTransmitPower, printf, seq_num_receptor, SR_PA_EXT_EN, tal_pib_set(), TAL_TRANSMIT_POWER_DEFAULT, and trx_bit_write().

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.

Parameters
framePointer 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, printf, 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_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.

Parameters
statusStatus of the transmission procedure
framePointer 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(), status, 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.

Parameters
float_valFloat 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 void send_peer_info_rsp ( void  )
static
static bool send_range_test_marker_cmd ( void  )
static
static void send_range_test_rsp ( uint8_t  seq_num,
uint32_t  frame_count,
int8_t  ed,
uint8_t  lqi 
)
static

Function used to send response to the received range test packet.

Parameters
seq_numsequence number of the range test packet received
frame_countCount of the received Range Test Packet
edED value of the received range test packet which has to be uploaded into the response payload
lqiLQI 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().

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().

uint32_t aver_lqi
static
uint32_t aver_rssi
static
uint8_t ed_scan_result_t::channel_no
uint8_t marker_seq_num = 0
static
uint32_t number_rx_frames
static
int8_t ed_scan_result_t::p_in
bool range_test_in_progress = false
static
uint8_t remote_cmd_len
static
uint8_t* remote_cmd_ptr
static
bool remote_cmd_rx = false
static