Initiator/Transmitter functionalities in PER Measurement mode - Performance Analyzer application This is the source code of a Packet Error Rate Measurement mode as Initiator.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "app_init.h"
#include "tfa.h"
#include "tal_internal.h"
#include "tal_helper.h"
#include "tal_constants.h"
#include "tal_pib.h"
#include "app_frame_format.h"
#include "perf_api.h"
#include "conf_board.h"
#include "perf_api_serial_handler.h"
Data Structures | |
struct | set_param_cb_t |
Structure used for updating the parameters after sending them to peer. More... | |
Functions | |
static float | calculate_net_data_rate (float per_test_duration_sec) |
Function to calculate net data rate for the current PER test. More... | |
static float | calculate_time_duration (void) |
Function to Calculate the time taken for PER Test. More... | |
uint8_t | check_error_conditions (void) |
Function to check the error conditions before. More... | |
static void | config_ack_request (bool config_value) |
To set or reset ACK request value. More... | |
static void | config_crc_peer_node (bool config_value) |
To configure CRC settings on peer node. More... | |
static void | config_csma (bool config_value) |
To configure CSMA Setting in the transceiver. More... | |
static void | config_frame_retry (bool config_value) |
To configure frame retry Setting. More... | |
static void | config_frequency (float frequency) |
Function to configure the ISM frequency based on the request. More... | |
static void | config_rpc_mode (bool config_value) |
toggle RPC mode request More... | |
static void | config_rx_desensitization (bool config_value) |
To configure rx desensitization level in the transceiver. More... | |
static void | configure_frame_sending (void) |
To Configure the frame sending. More... | |
static void | configure_range_test_frame_sending (void) |
To Configure the frame sending. More... | |
void | disconnect_peer_node (void) |
Function to request the peer to get disconnected from source node. More... | |
FLASH_DECLARE (uint8_t perf_config_param_size[]) | |
void | get_board_details (void) |
prints the hardware details More... | |
static void | get_crc_settings_peer_node (void) |
Function used to query CRC settings in remote node. More... | |
void | get_current_configuration (void) |
To Get the updated/latest values of all configurable parameters on source and peer node. More... | |
uint8_t | get_param_length (uint8_t parameter_type) |
void | get_sensor_data (void) |
To get the Sensor data like Battery voltage. More... | |
void | identify_peer_node (void) |
Identifying peer node. More... | |
void | initiate_per_test (void) |
Initiates the test procedure. More... | |
void | initiate_range_test (void) |
Initiates the Range test procedure. More... | |
void | per_mode_initiator_ed_end_cb (uint8_t energy_level) |
User call back function after ED Scan completion. More... | |
void | per_mode_initiator_init (void *parameter) |
Initialize the application in PER Measurement mode as Initiator. More... | |
void | per_mode_initiator_rx_cb (frame_info_t *frame) |
Callback that is called if data has been received by trx in the PER_FOUND_PER_INITIATOR state. More... | |
void | per_mode_initiator_task (void) |
Application task for PER Measurement mode as initiator. More... | |
void | per_mode_initiator_tx_done_cb (retval_t status, frame_info_t *frame) |
Callback that is called once tx is done in the PER_FOUND_PER_INITIATOR state . More... | |
void | perf_get_req (uint8_t param_type_data) |
Function to get the various configuaration paramters for PER Test. More... | |
void | perf_set_req (uint8_t set_param_type, param_value_t *param_value) |
static void | range_test_timer_handler_cb (void *parameter) |
This function is called periodically by the range test timer to initiate the transmission of range test packets to the receptor. More... | |
static bool | send_crc_set_req (crc_set_req_t crc_msg) |
Function used to change CRC settings on peer node. More... | |
static bool | send_crc_status_req (void) |
Function used to send crc status request to get CRC settings on the peer node. More... | |
static bool | send_disconnect_command (void) |
Function used to send disconnect peer node command. More... | |
static bool | send_identify_command (void) |
Function used to send identify peer node command. More... | |
static void | send_parameters_changed (uint8_t param, uint8_t val) |
Function to send the parameters which has been updated to the receptor node. More... | |
static bool | send_peer_info_req (void) |
Function to configure and send the peer node info request. More... | |
static bool | send_per_test_start_cmd (void) |
static bool | send_range_test_marker_rsp (void) |
Function to send the response packet for the marker sent from the receptor. More... | |
static bool | send_range_test_start_cmd (void) |
Function to send the range test start command to the receptor to start the mode in the receptor. More... | |
static bool | send_range_test_stop_cmd (void) |
Function to send the range test stop command to the receptor to stop the mode in the receptor. More... | |
void | send_remote_cmd (uint8_t *serial_buf, uint8_t len, bool ack_req) |
Function to send the command to Remote node to perform remote test. More... | |
static bool | send_result_req (void) |
Function used to request PER test result. More... | |
static bool | send_set_default_config_command (void) |
Function used to send set default config peer command. More... | |
static void | set_channel (uint16_t channel) |
To set the Channel. More... | |
static void | set_channel_page (uint8_t channel_page) |
To set the Channel Page. More... | |
void | set_default_configuration (void) |
To set the default values of all configurable parameters on source and peer node. More... | |
static void | set_parameter_on_transmitter_node (retval_t status) |
Set the parameters like channel,tx power etc on transmitter node. More... | |
static void | set_phy_frame_length (uint16_t frame_len) |
To set PER Test frame length. More... | |
static void | set_transceiver_state (uint8_t trx_state) |
Set Transceiver state as per the state given. More... | |
static void | set_tx_power (uint8_t tx_power_format, int8_t power_value) |
To set the Tx power of the Transceiver. More... | |
void | start_ed_scan (uint8_t ed_scan_duration, uint32_t channel_sel_mask) |
To start the ED scan. More... | |
static void | start_range_test (void) |
static void | start_test (void) |
void | stop_range_test (void) |
Function to Stop the range Test in PER Mode. More... | |
static void | toggle_trx_sleep (uint8_t sleep_mode) |
To toggle between sleep /deep state. More... | |
static void | wait_for_reply_timer_handler_cb (void *parameter) |
Wait for reply timer handler is called if any command sent on air times out before any response message is received. More... | |
Variables | |
static uint8_t | channel_before_scan |
static uint32_t | end_time |
static uint32_t | frame_access_failure |
static uint32_t | frame_failure |
static uint32_t | frame_no_ack |
static uint32_t | frames_to_transmit |
static uint32_t | fw_feature_mask = 0 |
This is variable is to keep track of the specific features supported. More... | |
static uint16_t | no_of_roll_overs |
static uint16_t | num_channels |
uint8_t | op_mode = TX_OP_MODE |
bool | pkt_stream_stop = true |
static uint32_t | range_test_frame_cnt = 0 |
static bool | range_test_in_progress = false |
static uint32_t | restart_time |
static uint32_t | scan_channel_mask |
static uint8_t | scan_duration |
static bool | scanning = false |
static uint8_t | seq_num_initiator |
static set_param_cb_t | set_param_cb |
static uint32_t | start_time |
static bool | trx_sleep_status = false |