Microchip® Advanced Software Framework

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

This module handles the functionalities of the Initiator in PER mode.

Modules

 PER mode Receptor
 This module handles the functionalities of the receptor in PER mode.
 

Macros

#define BIT_COUNT   (32)
 
#define CONTINUOUS_TX_MODE   (0x07)
 
#define CRC_SET_REQ_WAIT   (0x0A)
 
#define CRC_STATUS_REQ_WAIT   (0x09)
 
#define DEFAULT_FRAME_LENGTH   (20)
 
#define DEFAULT_NO_OF_TEST_FRAMES   (100)
 
#define DISCONNECT_PEER   (0x0C)
 
#define IDENTIFY_PEER   (0x08)
 
#define INVALID_VALUE   (0xff)
 
#define MAX_REG_ADDRESS   (0x3ffe)
 
#define MAX_SCAN_DURATION   (14)
 
#define MICRO_SEC_MULTIPLIER   (1.0 / 1000000)
 
#define MILLI_VOLT_MULTIPLIER   (1.0 / 1000)
 
#define MIN_REG_ADDRESS   (0x0000)
 
#define NO_OF_REGISTERS   (256)
 
#define NO_RX_DESENSITIZE_LEVEL   (0x00)
 
#define PEER_INFO_RSP_WAIT   (0x0B)
 
#define PER_TEST_START   (0x0E)
 
#define PULSE_CW_TX_TIME_IN_MICRO_SEC   (50000)
 
#define RANGE_TEST_START   (0x0F)
 
#define RANGE_TEST_STOP   (0x11)
 
#define RANGE_TEST_TX   (0x10)
 
#define RANGE_TST_PKT_SEQ_POS   (11)
 
#define RANGE_TX_BEACON_INTERVAL   (3000000)
 
#define RANGE_TX_BEACON_START_INTERVAL   (100000)
 
#define RX_DESENSITIZE_LEVEL   (0x08)
 
#define SET_DEFAULT_CONFIG_PEER   (0x0D)
 
#define SET_PARAMETER   (0x04)
 
#define TEST_FRAMES_SENT   (0x02)
 
#define TIMEOUT_FOR_RES_IN_MICRO_SEC_FOR_LDR   (500000)
 
#define TIMEOUT_FOR_RESPONSE_IN_MICRO_SEC   (2000000)
 
#define TIMEOUT_FOR_RESULT_RES_IN_MICRO_SEC   (300000)
 
#define TRX_RESET   (0)
 
#define TX_OP_MODE   (0x01)
 
#define WAIT_FOR_TEST_RES   (0x03)
 

Functions

static float calculate_net_data_rate (trx_id_t trx, float per_test_duration_sec)
 Function to calculate net data rate for the current PER test. More...
 
static float calculate_time_duration (trx_id_t trx)
 Function to Calculate the time taken for PER Test. More...
 
uint8_t check_error_conditions (trx_id_t trx)
 Function to check the error conditions before. More...
 
static void config_ack_request (trx_id_t trx, bool config_value)
 To set or reset ACK request value. More...
 
static void config_crc_peer_node (trx_id_t trx, bool config_value)
 To configure CRC settings on peer node. More...
 
static void config_csma (trx_id_t trx, bool config_value)
 To configure CSMA Setting in the transceiver. More...
 
static void config_frame_retry (trx_id_t trx, bool config_value)
 To configure frame retry Setting. More...
 
static void config_per_test_parameters (trx_id_t trx)
 Function to set trx configure parameters. More...
 
static void config_rx_desensitization (trx_id_t trx, bool config_value)
 To configure rx desensitization level in the transceiver. More...
 
static void configure_frame_sending (trx_id_t trx)
 To Configure the frame sending. More...
 
static void configure_range_test_frame_sending (trx_id_t trx)
 To Configure the frame sending. More...
 
void disconnect_peer_node (trx_id_t trx)
 Function to request the peer to get disconnected from source node. More...
 
void dump_trx_register_values (trx_id_t trx, uint16_t start_reg_addr, uint16_t end_reg_addr)
 Read a set of registers. More...
 
 FLASH_DECLARE (uint8_t perf_config_param_size[])
 
void get_board_details (trx_id_t trx)
 prints the hardware details More...
 
static void get_crc_settings_peer_node (trx_id_t trx)
 Function used to query CRC settings in remote node. More...
 
void get_current_configuration (trx_id_t trx)
 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 (trx_id_t trx)
 To get the Sensor data like Battery voltage. More...
 
void identify_peer_node (trx_id_t trx)
 Identifying peer node. More...
 
void initiate_per_test (trx_id_t trx)
 Initiates the test procedure. More...
 
void initiate_range_test (trx_id_t trx)
 Initiates the Range test procedure. More...
 
void per_mode_initiator_ed_end_cb (trx_id_t trx, uint8_t energy_level)
 User call back function after ED Scan completion. More...
 
void per_mode_initiator_init (trx_id_t trx, void *parameter)
 Initialize the application in PER Measurement mode as Initiator. More...
 
void per_mode_initiator_rx_cb (trx_id_t trx, 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 (trx_id_t trx)
 Application task for PER Measurement mode as initiator. More...
 
void per_mode_initiator_tx_done_cb (trx_id_t trx, 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 (trx_id_t trx, uint8_t param_type_data)
 Function to get the various configuration parameters for PER Test. More...
 
void perf_set_req (trx_id_t trx, uint8_t set_param_type, param_value_t *param_value)
 
More...
 
void perf_set_sun_page (trx_id_t trx, uint8_t *param_val)
 
More...
 
void pulse_cw_transmission (trx_id_t trx)
 
static void range_test_timer_handler_rf09_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 void range_test_timer_handler_rf24_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...
 
void read_trx_registers (trx_id_t trx, uint16_t reg_addr)
 Read transceiver register. More...
 
static void recover_all_settings (trx_id_t trx)
 Recover all user settings before Start of CW transmission. More...
 
static void save_all_settings (trx_id_t trx)
 Save all user settings before Start of CW transmission. More...
 
uint8_t scale_ed_to_reg_val (int8_t ed_val)
 
int8_t scale_reg_value_to_ed (uint8_t reg_val)
 
static bool send_crc_set_req (trx_id_t trx, crc_set_req_t crc_msg)
 Function used to change CRC settings on peer node. More...
 
static bool send_crc_status_req (trx_id_t trx)
 Function used to send crc status request to get CRC settings on the peer node. More...
 
static bool send_disconnect_command (trx_id_t trx)
 Function used to send disconnect peer node command. More...
 
static bool send_identify_command (trx_id_t trx)
 Function used to send identify peer node command. More...
 
static void send_parameters_changed (trx_id_t trx, uint8_t param, uint16_t val)
 Function to send the parameters which has been updated to the receptor node. More...
 
static bool send_peer_info_req (trx_id_t trx)
 Function to configure and send the peer node info request. More...
 
static bool send_per_test_start_cmd (trx_id_t trx)
 
static bool send_range_test_marker_rsp (trx_id_t trx)
 Function to send the response packet for the marker sent from the receptor. More...
 
static bool send_range_test_start_cmd (trx_id_t trx)
 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 (trx_id_t trx)
 Function to send the range test stop command to the receptor to stop the mode in the receptor. More...
 
static bool send_result_req (trx_id_t trx)
 Function used to request PER test result. More...
 
static bool send_set_default_config_command (trx_id_t trx)
 Function used to send set default config peer command. More...
 
static void send_sun_page_changed (trx_id_t trx)
 
static void set_channel_app (trx_id_t trx, uint16_t channel)
 To set the Channel. More...
 
static void set_channel_page (trx_id_t trx, uint8_t channel_page)
 To set the Channel Page. More...
 
void set_default_configuration (trx_id_t trx)
 To set the default values of all configurable parameters on source and peer node. More...
 
static void set_parameter_on_transmitter_node (trx_id_t trx, retval_t status)
 Set the parameters like channel,tx power etc on transmitter node. More...
 
static void set_phy_frame_length (trx_id_t trx, uint16_t frame_len)
 To set PER Test frame length. More...
 
static void set_transceiver_state (trx_id_t trx, uint8_t transceiver_state)
 Set Transceiver state as per the state given. More...
 
static void set_tx_power (trx_id_t trx, uint8_t tx_power_format, int8_t power_value)
 To set the Tx power of the Transceiver. More...
 
void start_cw_transmission (trx_id_t trx, uint8_t tx_mode)
 
void start_ed_scan (trx_id_t trx, uint8_t ed_scan_duration, uint32_t channel_sel_mask)
 To start the ED scan. More...
 
static void start_range_test (trx_id_t trx)
 
static void start_test (trx_id_t trx)
 
void stop_cw_transmission (trx_id_t trx, uint8_t tx_mode)
 
static void stop_pulse_cb (void *callback_parameter)
 Stop sending a CW signal on current channel page. More...
 
void stop_range_test (trx_id_t trx)
 Function to Stop the range Test in PER Mode. More...
 
static void toggle_trx_sleep (trx_id_t trx)
 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...
 
void write_trx_registers (trx_id_t trx, uint16_t reg_addr, uint8_t reg_val)
 write Transceiver registers More...
 

Variables

static uint16_t channel_before_scan [NUM_TRX]
 
trx_config_params_t curr_trx_config_params [NUM_TRX]
 
trx_config_params_t default_trx_config_params [NUM_TRX]
 
static uint32_t end_time [NUM_TRX]
 
static uint32_t frame_access_failure [NUM_TRX]
 
static uint32_t frame_failure [NUM_TRX]
 
static uint32_t frame_no_ack [NUM_TRX]
 
static uint32_t frames_to_transmit [NUM_TRX]
 
static uint32_t fw_feature_mask = 0
 This is variable is to keep track of the specific features supported. More...
 
static uint8_t last_tx_power_format_set [NUM_TRX]
 
static uint16_t no_of_roll_overs [NUM_TRX]
 
static uint8_t num_channels [NUM_TRX]
 
static uint8_t op_mode [NUM_TRX] = {TX_OP_MODE, TX_OP_MODE}
 
uint8_t set_param_cb_t::param_type
 
uint16_t set_param_cb_t::param_value
 
static bool peer_found [NUM_TRX] = {false, false}
 
static uint32_t range_test_frame_cnt [NUM_TRX] = {0, 0}
 
static bool range_test_in_progress [NUM_TRX] = {false, false}
 
static uint32_t restart_time [NUM_TRX]
 
static uint32_t scan_channel_mask [NUM_TRX]
 
static uint8_t scan_duration [NUM_TRX]
 
static bool scanning [NUM_TRX] = {false, false}
 
static uint8_t seq_num_initiator [NUM_TRX]
 
static set_param_cb_t set_param_cb [NUM_TRX]
 
static uint32_t start_time [NUM_TRX]
 
sun_phy_t sun_page [NUM_TRX]
 
static uint8_t * sun_page_param_val [NUM_TRX]
 
phy_t sun_phy_page_set [NUM_TRX]
 
static bool trx_sleep_status [NUM_TRX] = {false, false}
 

#define BIT_COUNT   (32)

Referenced by set_channel_app().

#define CRC_SET_REQ_WAIT   (0x0A)
#define DEFAULT_FRAME_LENGTH   (20)
#define DEFAULT_NO_OF_TEST_FRAMES   (100)
#define DISCONNECT_PEER   (0x0C)
#define IDENTIFY_PEER   (0x08)
#define MAX_REG_ADDRESS   (0x3ffe)
#define MAX_SCAN_DURATION   (14)

Referenced by start_ed_scan().

#define MICRO_SEC_MULTIPLIER   (1.0 / 1000000)
#define MILLI_VOLT_MULTIPLIER   (1.0 / 1000)

Referenced by get_sensor_data().

#define MIN_REG_ADDRESS   (0x0000)
#define NO_OF_REGISTERS   (256)
#define NO_RX_DESENSITIZE_LEVEL   (0x00)
#define PEER_INFO_RSP_WAIT   (0x0B)
#define PER_TEST_START   (0x0E)
#define PULSE_CW_TX_TIME_IN_MICRO_SEC   (50000)

Referenced by pulse_cw_transmission().

#define RANGE_TEST_START   (0x0F)
#define RANGE_TEST_STOP   (0x11)
#define RANGE_TST_PKT_SEQ_POS   (11)
#define RANGE_TX_BEACON_INTERVAL   (3000000)
#define RANGE_TX_BEACON_START_INTERVAL   (100000)

Referenced by start_range_test().

#define RX_DESENSITIZE_LEVEL   (0x08)
#define SET_DEFAULT_CONFIG_PEER   (0x0D)
#define TEST_FRAMES_SENT   (0x02)
#define TIMEOUT_FOR_RES_IN_MICRO_SEC_FOR_LDR   (500000)

Referenced by per_mode_initiator_task().

#define TIMEOUT_FOR_RESPONSE_IN_MICRO_SEC   (2000000)
#define TIMEOUT_FOR_RESULT_RES_IN_MICRO_SEC   (300000)

Referenced by per_mode_initiator_task().

#define TRX_RESET   (0)

Referenced by set_transceiver_state().

static float calculate_net_data_rate ( trx_id_t  trx,
float  per_test_duration_sec 
)
static

Function to calculate net data rate for the current PER test.

Parameters
per_test_duration_secTime duration for PER test
Returns
net data rate as float value

References trx_config_params_t::number_test_frames, and trx_config_params_t::phy_frame_length.

Referenced by per_mode_initiator_rx_cb().

static float calculate_time_duration ( trx_id_t  trx)
static

Function to Calculate the time taken for PER Test.

Returns
Time duration as float value

References end_time, MICRO_SEC_MULTIPLIER, no_of_roll_overs, start_time, and SUB_TIME.

Referenced by per_mode_initiator_rx_cb().

uint8_t check_error_conditions ( trx_id_t  trx)

Function to check the error conditions before.

Function used to check the error conditions before.

processing the received command

Returns
the error code based on the currently ongoing operation,if any

References CONTINUOUS_TX_MODE, CW_TRANSMISSION_UNDER_PROGRESS, ED_SCAN_UNDER_PROGRESS, frames_to_transmit, MAC_SUCCESS, op_mode, RANGE_TEST_IN_PROGRESS, range_test_in_progress, scanning, TRANSCEIVER_IN_SLEEP, TRANSMISSION_UNDER_PROGRESS, and trx_sleep_status.

Referenced by handle_incoming_msg().

static void config_ack_request ( trx_id_t  trx,
bool  config_value 
)
static

To set or reset ACK request value.

Parameters
config_valuevalue to be configured

References trx_config_params_t::ack_request, MAC_SUCCESS, PARAM_ACK_REQUEST, and usr_perf_set_confirm().

Referenced by perf_set_req().

static void config_crc_peer_node ( trx_id_t  trx,
bool  config_value 
)
static

To configure CRC settings on peer node.

Parameters
config_valueValue used to configure CRC on peer

References CRC_SET_REQ_WAIT, INVALID_CMD, op_mode, PARAM_CRC_ON_PEER, peer_found, send_crc_set_req(), crc_set_req_t::status, TRANSMISSION_FAILURE, TX_OP_MODE, and usr_perf_set_confirm().

Referenced by perf_set_req().

static void config_csma ( trx_id_t  trx,
bool  config_value 
)
static

To configure CSMA Setting in the transceiver.

Parameters
config_valuevalue to be configured

References trx_config_params_t::csma_enabled, MAC_SUCCESS, PARAM_CSMA, and usr_perf_set_confirm().

Referenced by perf_set_req().

static void config_frame_retry ( trx_id_t  trx,
bool  config_value 
)
static

To configure frame retry Setting.

Parameters
config_valuevalue to be configured

References MAC_SUCCESS, PARAM_FRAME_RETRY, trx_config_params_t::retry_enabled, and usr_perf_set_confirm().

Referenced by perf_set_req().

static void config_rx_desensitization ( trx_id_t  trx,
bool  config_value 
)
static

To configure rx desensitization level in the transceiver.

Parameters
config_valueValue used to configure Rx desensitization

References MAC_SUCCESS, NO_RX_DESENSITIZE_LEVEL, PARAM_DESENSITIZATION, RX_DESENSITIZE_LEVEL, tal_set_rx_sensitivity_level(), and usr_perf_set_confirm().

Referenced by perf_set_req().

void disconnect_peer_node ( trx_id_t  trx)

Function to request the peer to get disconnected from source node.

References app_reset(), DISCONNECT_PEER, MAC_SUCCESS, node_info, op_mode, peer_found, send_disconnect_command(), TRANSMISSION_FAILURE, TX_OP_MODE, and usr_peer_disconnect_confirm().

Referenced by handle_incoming_msg().

void dump_trx_register_values ( trx_id_t  trx,
uint16_t  start_reg_addr,
uint16_t  end_reg_addr 
)

Read a set of registers.

Parameters
start_reg_addrThe start address of the group of registers to be read
end_reg_addrThe end register of the group of registers to be read

References INVALID_REGISTER_ORDER, MAC_SUCCESS, NO_OF_REGISTERS, NUL_VAL, tal_dump_registers(), usr_register_dump_confirm(), and VALUE_OUT_OF_RANGE.

Referenced by handle_incoming_msg().

FLASH_DECLARE ( uint8_t  perf_config_param_size[])
static void get_crc_settings_peer_node ( trx_id_t  trx)
static
void get_current_configuration ( trx_id_t  trx)

To Get the updated/latest values of all configurable parameters on source and peer node.

Function to get the current values of the all configurabel patameters.

References MAC_SUCCESS, and usr_get_current_config_confirm().

Referenced by handle_incoming_msg().

uint8_t get_param_length ( uint8_t  parameter_type)
void get_sensor_data ( trx_id_t  trx)

To get the Sensor data like Battery voltage.

Function to get the Sensor data like Battery volatge.

References MAC_SUCCESS, MILLI_VOLT_MULTIPLIER, reverse_float(), tfa_get_batmon_voltage(), tfa_get_temperature(), and usr_sensor_data_get_confirm().

Referenced by handle_incoming_msg().

void identify_peer_node ( trx_id_t  trx)
void initiate_per_test ( trx_id_t  trx)
void initiate_range_test ( trx_id_t  trx)
void per_mode_initiator_ed_end_cb ( trx_id_t  trx,
uint8_t  energy_level 
)

User call back function after ED Scan completion.

Parameters
energylevel as input

Send the ED_END_INDICATION with the no. of channels and the list with channel no and pin values

References channel_before_scan, ed_scan_result_t::channel_no, INVALID_VALUE, num_channels, NUM_TRX, ed_scan_result_t::p_in, phyCurrentChannel, phyCurrentPage, RF09, scan_channel_mask, scan_duration, scanning, tal_ed_start(), tal_pib_get(), tal_pib_set(), and usr_ed_scan_end_indication().

void per_mode_initiator_init ( trx_id_t  trx,
void *  parameter 
)
void per_mode_initiator_rx_cb ( trx_id_t  trx,
frame_info_t frame 
)

Callback that is called if data has been received by trx in the PER_FOUND_PER_INITIATOR state.

Parameters
framePointer to received frame

References app_led_event(), APP_TIMER_TO_TX, aver_lqi, peer_info_rsp_t::board_name, calculate_net_data_rate(), calculate_time_duration(), CCPU_ENDIAN_TO_LE32, app_payload_t::cmd_id, general_pkt_t::crc_stat_rsp_data, CRC_STATUS_REQ_WAIT, range_tx_t::ed, peer_info_rsp_t::feature_mask, frame_access_failure, frame_failure, frame_no_ack, FRAME_OVERHEAD, frames_with_wrong_crc, result_rsp_t::frames_with_wrong_crc, FUNC_PTR, peer_info_rsp_t::fw_version, peer_info_rsp_t::ic_type, LED_BLINK_RATE_IN_MICRO_SEC, LED_EVENT_RX_FRAME, frame_info_tag::len_no_crc, range_tx_t::lqi, result_rsp_t::lqi_avrg_rx, peer_info_rsp_t::mac_address, MAC_SUCCESS, marker_rsp_timer_handler_cb(), frame_info_tag::mpdu, result_rsp_t::num_of_frames_rx, NUM_TRX, number_rx_frames, op_mode, PARAM_CRC_ON_PEER, app_payload_t::payload, PEER_INFO_RSP, general_pkt_t::peer_info_rsp_data, PEER_INFO_RSP_WAIT, RANGE_TEST_MARKER_CMD, RANGE_TEST_RSP, RANGE_TEST_TX, general_pkt_t::range_tx_data, RESULT_RSP, reverse_float(), result_rsp_t::rssi_avrg_rx, send_range_test_marker_rsp(), app_payload_t::seq_num, peer_info_rsp_t::soc_mcu_name, START_MODE_PER, crc_stat_rsp_t::status, SW_TIMEOUT_RELATIVE, sw_timer_start(), sw_timer_stop(), T_APP_TIMER, tal_pib, general_pkt_t::test_result_rsp_data, peer_info_rsp_t::trx_name, TX_OP_MODE, usr_per_test_end_indication(), usr_perf_get_confirm(), usr_perf_start_confirm(), usr_range_test_beacon_rsp(), usr_range_test_marker_ind(), and WAIT_FOR_TEST_RES.

void per_mode_initiator_task ( trx_id_t  trx)
void per_mode_initiator_tx_done_cb ( trx_id_t  trx,
retval_t  status,
frame_info_t frame 
)

Callback that is called once tx is done in the PER_FOUND_PER_INITIATOR state .

Parameters
statusStatus of the transmission procedure
framePointer to the transmitted frame structure

References app_led_event(), app_reset(), APP_TIMER_TO_TX, APP_TIMER_TO_TX_LED_OFF, CH_PG_SUN, trx_config_params_t::channel, trx_config_params_t::channel_page, app_payload_t::cmd_id, config_per_test_parameters(), CONTINUOUS_TX_MODE, general_pkt_t::crc_set_req_data, CRC_SET_REQ_WAIT, CRC_STATUS_REQ_WAIT, DISCONNECT_PEER, end_time, frame_access_failure, frame_failure, frame_no_ack, FRAME_OVERHEAD, frames_to_transmit, FSK, IDENTIFY_PEER, INVALID_VALUE, LED_EVENT_PEER_SEARCH_DONE, LED_EVENT_TX_FRAME, LED_TOGGLE_COUNT_FOR_PER, LEG_OQPSK, MAC_CHANNEL_ACCESS_FAILURE, MAC_NO_ACK, MAC_SUCCESS, MICRO_SEC_MULTIPLIER, frame_info_tag::mpdu, no_of_roll_overs, node_info, NUL_VAL, OFDM, op_mode, OQPSK, OQPSK_DATA_RATE_250, PARAM_CHANNEL_PAGE, PARAM_CRC_ON_PEER, app_payload_t::payload, PER_TEST_START, phy_tag::phy_mode, phyCurrentChannel, phyFSKFECEnabled, phyHighRateEnabled, phyOFDMMCS, phyOQPSKRateMode, phySetting, range_test_frame_cnt, range_test_in_progress, RANGE_TEST_PKT, RANGE_TEST_START, RANGE_TEST_STOP, RANGE_TEST_TX, restart_time, RF24, SET_DEFAULT_CONFIG_PEER, SET_PARAMETER, set_parameter_on_transmitter_node(), SET_SUN_PAGE, start_range_test(), start_test(), crc_set_req_t::status, sun_page_param_val, sw_timer_get_time(), sw_timer_stop(), T_APP_TIMER_RANGE_RF09, T_APP_TIMER_RANGE_RF24, tal_pib, tal_pib_get(), tal_pib_set(), TEST_FRAMES_SENT, node_ib_t::transmitting, TX_OP_MODE, UNABLE_TO_CONTACT_PEER, usr_identify_peer_node_confirm(), usr_peer_disconnect_confirm(), usr_per_test_end_indication(), usr_perf_set_confirm(), usr_range_test_beacon_tx(), usr_range_test_start_confirm(), usr_range_test_stop_confirm(), usr_set_default_config_confirm(), and WAIT_FOR_TEST_RES.

void perf_set_sun_page ( trx_id_t  trx,
uint8_t *  param_val 
)
static void range_test_timer_handler_rf09_cb ( void *  parameter)
static

This function is called periodically by the range test timer to initiate the transmission of range test packets to the receptor.

Parameters
parameterpass parameters to timer handler

References configure_range_test_frame_sending(), CSMA_UNSLOTTED, FUNC_PTR, node_info, RANGE_TX_BEACON_INTERVAL, RF09, SW_TIMEOUT_RELATIVE, sw_timer_start(), T_APP_TIMER_RANGE_RF09, tal_tx_frame(), and node_ib_t::transmitting.

Referenced by start_range_test().

static void range_test_timer_handler_rf24_cb ( void *  parameter)
static

This function is called periodically by the range test timer to initiate the transmission of range test packets to the receptor.

Parameters
parameterpass parameters to timer handler

References configure_range_test_frame_sending(), CSMA_UNSLOTTED, FUNC_PTR, node_info, RANGE_TX_BEACON_INTERVAL, RF24, SW_TIMEOUT_RELATIVE, sw_timer_start(), T_APP_TIMER_RANGE_RF24, tal_tx_frame(), and node_ib_t::transmitting.

Referenced by start_range_test().

void read_trx_registers ( trx_id_t  trx,
uint16_t  reg_addr 
)

Read transceiver register.

Parameters
reg_addrThe address of the register to be read

References INVALID_VALUE, MAC_SUCCESS, MAX_REG_ADDRESS, tal_trx_reg_read(), usr_register_read_confirm(), and VALUE_OUT_OF_RANGE.

Referenced by handle_incoming_msg().

static void recover_all_settings ( trx_id_t  trx)
static

Recover all user settings before Start of CW transmission.

References phyTransmitPower, RX_DESENSITIZE_LEVEL, tal_pib_set(), and tal_set_rx_sensitivity_level().

Referenced by set_transceiver_state(), stop_cw_transmission(), and stop_pulse_cb().

static void save_all_settings ( trx_id_t  trx)
static

Save all user settings before Start of CW transmission.

Referenced by pulse_cw_transmission(), set_transceiver_state(), and start_cw_transmission().

uint8_t scale_ed_to_reg_val ( int8_t  ed_val)
int8_t scale_reg_value_to_ed ( uint8_t  reg_val)
static bool send_crc_set_req ( trx_id_t  trx,
crc_set_req_t  crc_msg 
)
static

Function used to change CRC settings on peer node.

Parameters
crc_msgCRC settings for peer node
Returns
Trasmission status - success/failure

References app_transmit_frame(), app_payload_t::cmd_id, general_pkt_t::crc_set_req_data, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, app_payload_t::payload, node_ib_t::peer_short_addr, app_payload_t::seq_num, and seq_num_initiator.

Referenced by config_crc_peer_node().

static bool send_crc_status_req ( trx_id_t  trx)
static

Function used to send crc status request to get CRC settings on the peer node.

Returns
Trasmission status - success/failure

References app_transmit_frame(), app_payload_t::cmd_id, data, DUMMY_PAYLOAD, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, app_payload_t::payload, node_ib_t::peer_short_addr, app_payload_t::seq_num, seq_num_initiator, and crc_stat_req_t::status.

Referenced by get_crc_settings_peer_node().

static bool send_disconnect_command ( trx_id_t  trx)
static

Function used to send disconnect peer node command.

Returns
Trasmission status - success/failure

References app_transmit_frame(), app_payload_t::cmd_id, DISCONNECT_NODE, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, node_ib_t::peer_short_addr, app_payload_t::seq_num, and seq_num_initiator.

Referenced by disconnect_peer_node().

static bool send_identify_command ( trx_id_t  trx)
static

Function used to send identify peer node command.

Returns
Trasmission status - success/failure

References app_transmit_frame(), app_payload_t::cmd_id, FCF_SHORT_ADDR, IDENTIFY_NODE, MAC_SUCCESS, node_info, node_ib_t::peer_short_addr, app_payload_t::seq_num, and seq_num_initiator.

Referenced by identify_peer_node().

static void send_parameters_changed ( trx_id_t  trx,
uint8_t  param,
uint16_t  val 
)
static

Function to send the parameters which has been updated to the receptor node.

Parameters
paramParameters being modified i.e. Channel,channel page,etc
valValue of the parameter being modified

References app_transmit_frame(), app_payload_t::cmd_id, data, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, op_mode, set_param_cb_t::param_type, set_parm_req_t::param_type, set_param_cb_t::param_value, set_parm_req_t::param_value, app_payload_t::payload, node_ib_t::peer_short_addr, app_payload_t::seq_num, seq_num_initiator, SET_PARAM, and SET_PARAMETER.

Referenced by set_channel_app(), set_channel_page(), and set_tx_power().

static bool send_peer_info_req ( trx_id_t  trx)
static

Function to configure and send the peer node info request.

Returns
Trasmission status - success/failure

References app_transmit_frame(), app_payload_t::cmd_id, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, PEER_INFO_REQ, node_ib_t::peer_short_addr, app_payload_t::seq_num, and seq_num_initiator.

Referenced by per_mode_initiator_init().

static bool send_range_test_start_cmd ( trx_id_t  trx)
static
static bool send_range_test_stop_cmd ( trx_id_t  trx)
static
static bool send_result_req ( trx_id_t  trx)
static

Function used to request PER test result.

Returns
true if request was sent successfully, false if not.

References app_transmit_frame(), result_req_t::cmd, app_payload_t::cmd_id, data, DUMMY_PAYLOAD, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, app_payload_t::payload, node_ib_t::peer_short_addr, RESULT_REQ, app_payload_t::seq_num, and seq_num_initiator.

Referenced by per_mode_initiator_task().

static bool send_set_default_config_command ( trx_id_t  trx)
static

Function used to send set default config peer command.

Returns
Trasmission status - success/failure

References app_transmit_frame(), app_payload_t::cmd_id, FCF_SHORT_ADDR, MAC_SUCCESS, node_info, node_ib_t::peer_short_addr, app_payload_t::seq_num, seq_num_initiator, and SET_DEFAULT_REQ.

Referenced by set_default_configuration().

static void set_channel_page ( trx_id_t  trx,
uint8_t  channel_page 
)
static
void set_default_configuration ( trx_id_t  trx)

To set the default values of all configurable parameters on source and peer node.

Function to set the default values of.

References config_per_test_parameters(), MAC_SUCCESS, op_mode, peer_found, send_set_default_config_command(), SET_DEFAULT_CONFIG_PEER, TRANSMISSION_FAILURE, TX_OP_MODE, and usr_set_default_config_confirm().

Referenced by handle_incoming_msg().

static void set_phy_frame_length ( trx_id_t  trx,
uint16_t  frame_len 
)
static

To set PER Test frame length.

Parameters
frame_lenLength of the frame to be set

References aMaxPHYPacketSize, aMaxPHYPacketSize_4g, configure_frame_sending(), FRAME_OVERHEAD, LEG_OQPSK, MAC_SUCCESS, PARAM_PHY_FRAME_LENGTH, trx_config_params_t::phy_frame_length, tal_pib, and usr_perf_set_confirm().

Referenced by perf_set_req().

static void set_transceiver_state ( trx_id_t  trx,
uint8_t  transceiver_state 
)
static
static void set_tx_power ( trx_id_t  trx,
uint8_t  tx_power_format,
int8_t  power_value 
)
static

To set the Tx power of the Transceiver.

Parameters
tx_power_formatFormat in which input is given whether in dBm or reg
power_valueTx power value in the given format

References MAC_SUCCESS, MAX_TX_PWR_REG_VAL, PARAM_TX_POWER_DBM, peer_found, phyTransmitPower, send_parameters_changed(), tal_convert_reg_value_to_dBm(), tal_get_curr_trx_config(), tal_pib_set(), TX_POWER_DBM, trx_config_params_t::tx_power_dbm, TX_POWER_FORMAT_DBM, TX_POWER_FORMAT_REG, TX_PWR, usr_perf_set_confirm(), and VALUE_OUT_OF_RANGE.

Referenced by perf_set_req().

void start_ed_scan ( trx_id_t  trx,
uint8_t  ed_scan_duration,
uint32_t  channel_sel_mask 
)

To start the ED scan.

Function to start the ED scan.

Parameters
ed_scan_durationScan duration parameter which is used to calculate the scan time on each channel

References aBaseSuperframeDuration, channel_before_scan, MAC_SUCCESS, MAX_SCAN_DURATION, NUL_VAL, num_channels, phyChannelsSupported, phyCurrentChannel, reverse_float(), scan_channel_mask, scan_duration, scanning, TAL_CONVERT_SYMBOLS_TO_US, tal_ed_start(), tal_pib_get(), tal_pib_set(), usr_ed_scan_start_confirm(), and VALUE_OUT_OF_RANGE.

Referenced by handle_incoming_msg().

void stop_cw_transmission ( trx_id_t  trx,
uint8_t  tx_mode 
)
static void stop_pulse_cb ( void *  callback_parameter)
static

Stop sending a CW signal on current channel page.

Parameters
callback_parameterPointer to callback, not used here

References MAC_SUCCESS, op_mode, recover_all_settings(), tfa_continuous_tx_stop(), TX_OP_MODE, and usr_cont_pulse_tx_confirm().

Referenced by pulse_cw_transmission().

void stop_range_test ( trx_id_t  trx)
static void toggle_trx_sleep ( trx_id_t  trx)
static

To toggle between sleep /deep state.

Parameters
sleep_modeType of sleep mode as input in case of RF233

References MAC_SUCCESS, RF09, RF24, tal_trx_sleep(), tal_trx_wakeup(), and trx_sleep_status.

Referenced by set_transceiver_state().

static void wait_for_reply_timer_handler_cb ( void *  parameter)
static

Wait for reply timer handler is called if any command sent on air times out before any response message is received.

This function handles all the scenarios if the remote node is not accessible

Parameters
parameterpass parameters to timer handler

References app_reset(), CRC_STATUS_REQ_WAIT, NO_PEER_FOUND, NUL_VAL, op_mode, PARAM_CRC_ON_PEER, PEER_INFO_RSP_WAIT, START_MODE_PER, TX_OP_MODE, UNABLE_TO_CONTACT_PEER, usr_per_test_end_indication(), usr_perf_get_confirm(), usr_perf_start_confirm(), and WAIT_FOR_TEST_RES.

Referenced by get_crc_settings_peer_node(), per_mode_initiator_init(), and per_mode_initiator_task().

void write_trx_registers ( trx_id_t  trx,
uint16_t  reg_addr,
uint8_t  reg_val 
)

write Transceiver registers

Parameters
reg_addrThe address of the register to be read
reg_valThe value of the register to be written

References MAC_SUCCESS, MAX_REG_ADDRESS, tal_trx_reg_write(), usr_register_write_confirm(), and VALUE_OUT_OF_RANGE.

Referenced by handle_incoming_msg().

uint16_t channel_before_scan[NUM_TRX]
static
trx_config_params_t curr_trx_config_params[NUM_TRX]
trx_config_params_t default_trx_config_params[NUM_TRX]
uint32_t end_time[NUM_TRX]
static
uint32_t frame_access_failure[NUM_TRX]
static
uint32_t frame_failure[NUM_TRX]
static
uint32_t frame_no_ack[NUM_TRX]
static
uint32_t fw_feature_mask = 0
static

This is variable is to keep track of the specific features supported.

Referenced by get_board_details(), and usr_identify_board_confirm().

uint8_t last_tx_power_format_set[NUM_TRX]
static

Referenced by perf_set_req().

uint16_t no_of_roll_overs[NUM_TRX]
static
uint8_t num_channels[NUM_TRX]
static
uint8_t set_param_cb_t::param_type

Referenced by send_parameters_changed().

uint16_t set_param_cb_t::param_value
uint32_t range_test_frame_cnt[NUM_TRX] = {0, 0}
static
uint32_t restart_time[NUM_TRX]
static
uint32_t scan_channel_mask[NUM_TRX]
static
uint8_t scan_duration[NUM_TRX]
static
set_param_cb_t set_param_cb[NUM_TRX]
static
sun_phy_t sun_page[NUM_TRX]
uint8_t* sun_page_param_val[NUM_TRX]
static
phy_t sun_phy_page_set[NUM_TRX]
bool trx_sleep_status[NUM_TRX] = {false, false}
static