Microchip® Advanced Software Framework

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

Performs the functionalities of Range measurement mode, Evaluate the Communication coverage of the transceiver.

Macros

#define APP_SEND_TEST_PKT_INTERVAL_IN_MICRO_SEC   (250000)
 
#define DATA_PKT   (0x00)
 

Functions

void app_print_statistics (void)
 Print the statistics for Range Measurement on the UART Terminal. More...
 
static int range_test_frame_tx (void)
 Send Range Measurement mode test frames to the peer device. More...
 
void range_test_rx_cb (frame_info_t *frame)
 Callback that is called if data has been received by trx when the node is in Range Measurement mode i.e RANGE_TEST_TX_ON or RANGE_TEST_TX_OFF. More...
 
void range_test_tx_off_task (void)
 Application task handling Range Measurement when the node is in RANGE_TEST_TX_OFF state, where no TX is enabled and only RX is ON. More...
 
void range_test_tx_on_exit (void)
 To exit the Application task from RANGE_TEST_TX_ON state, where both TX and RX is enabled. More...
 
void range_test_tx_on_init (void *arg)
 Initialization of Range Measurement mode in RANGE_TX_ON State. More...
 
void range_test_tx_on_task (void)
 Application task handling Range Measurement when the node is in RANGE_TEST_TX_ON state, where both TX and RX is enabled. More...
 
static void range_test_tx_timer_handler_cb (void *parameter)
 Callback function that handles timer in Range Measurement Mode. More...
 

Variables

static uint32_t num_of_frames_rec
 
static uint32_t num_of_frames_send
 
static uint8_t seq_num
 

#define APP_SEND_TEST_PKT_INTERVAL_IN_MICRO_SEC   (250000)
#define DATA_PKT   (0x00)

void app_print_statistics ( void  )

Print the statistics for Range Measurement on the UART Terminal.

References num_of_frames_rec, and num_of_frames_send.

static int range_test_frame_tx ( void  )
static

Send Range Measurement mode test frames to the peer device.

This is a unicast with source address and destination addresses which were set during peer search process

References app_payload_t::cmd_id, data, DATA_PKT, FCF_SHORT_ADDR, node_info, num_of_frames_send, app_payload_t::payload, node_ib_t::peer_short_addr, data_pkt_range_test_t::pkt_count, seq_num, app_payload_t::seq_num, and transmit_frame().

Referenced by range_test_tx_timer_handler_cb().

void range_test_rx_cb ( frame_info_t frame)

Callback that is called if data has been received by trx when the node is in Range Measurement mode i.e RANGE_TEST_TX_ON or RANGE_TEST_TX_OFF.

Parameters
framePointer to received frame

References app_led_event(), app_payload_t::cmd_id, DATA_PKT, FCS_LEN, FRAME_OVERHEAD, LED_EVENT_RX_FRAME, LENGTH_FIELD_LEN, frame_info_tag::mpdu, and num_of_frames_rec.

void range_test_tx_off_task ( void  )

Application task handling Range Measurement when the node is in RANGE_TEST_TX_OFF state, where no TX is enabled and only RX is ON.

References app_debounce_button(), print_event(), PRINT_RANGE_MEASURE_STATSTICS, RANGE_TEST_TX_ON, set_main_state(), and sio2host_getchar_nowait().

void range_test_tx_on_exit ( void  )

To exit the Application task from RANGE_TEST_TX_ON state, where both TX and RX is enabled.

References APP_TIMER_TO_TX, print_event(), PRINT_RANGE_MEASURE_TX_STOP, and sw_timer_stop().

void range_test_tx_on_init ( void *  arg)

Initialization of Range Measurement mode in RANGE_TX_ON State.

Parameters
argarguments to init RANGE_TX_ON state

References APP_SEND_TEST_PKT_INTERVAL_IN_MICRO_SEC, APP_TIMER_TO_TX, FUNC_PTR, NULL, print_event(), PRINT_RANGE_MEASURE_TX_START, range_test_tx_timer_handler_cb(), seq_num, SW_TIMEOUT_RELATIVE, and sw_timer_start().

void range_test_tx_on_task ( void  )

Application task handling Range Measurement when the node is in RANGE_TEST_TX_ON state, where both TX and RX is enabled.

References app_debounce_button(), NULL, print_event(), PRINT_RANGE_MEASURE_STATSTICS, RANGE_TEST_TX_OFF, set_main_state(), and sio2host_getchar_nowait().

static void range_test_tx_timer_handler_cb ( void *  parameter)
static

Callback function that handles timer in Range Measurement Mode.

Parameters
parameterpass parameters to timer handler

References app_led_event(), APP_SEND_TEST_PKT_INTERVAL_IN_MICRO_SEC, APP_TIMER_TO_TX, FUNC_PTR, LED_EVENT_TX_FRAME, NULL, num_of_frames_send, range_test_frame_tx(), SW_TIMEOUT_RELATIVE, and sw_timer_start().

Referenced by range_test_tx_on_init().

uint32_t num_of_frames_rec
static
uint32_t num_of_frames_send
static
uint8_t seq_num
static