Handles all the serial input and output commands.
It de-serializes the incoming Performance Analyzer Req Msg packets and calls the corresponding Performance Analyzer APIs to process the request. It also serializes the Performance Analyzer confirmation and indication Msgs which are generated by the application. It expects the packet to be received or send the packets through serial interface in the following format.
---------------------------------------------------------------—
| SOT | Length | Protocol Id | Msg Id | Msg Payload | EOT |
---------------------------------------------------------------—
Data Structures | |
union | param_value_t |
Paramter value types. More... | |
Macros | |
#define | PROTOCOL_ID |
This indicates the PROTOCOL_ID field in the Serial Parser frame format. More... | |
Functions | |
void | sio_write (uint8_t *message) |
Function to write messages into UART/USB, used to send assert messages. More... | |
Variables | |
uint16_t | param_value_t::param_value_16bit |
Parameter 16-bit. More... | |
uint32_t | param_value_t::param_value_32bit |
Parameter 32-bit. More... | |
uint64_t | param_value_t::param_value_64bit |
Parameter 64-bit. More... | |
uint8_t | param_value_t::param_value_8bit |
Parameter 8-bit. More... | |
bool | param_value_t::param_value_bool |
Parameter Bool. More... | |
float | param_value_t::param_value_float |
Parameter float. More... | |
UART COMMUNICATION FRAMING | |
static uint8_t | sio_rx_buf [NUM_TRX][SIO_RX_BUF_SIZE] |
This is the receive buffer of the UART. More... | |
static uint8_t | sio_tx_buf [NUM_TRX][SIO_BUF_COUNT][SIO_TX_BUF_SIZE] |
This is the transmit buffer of the UART. More... | |
static uint8_t * | sio_rx_ptr [NUM_TRX] |
This pointer points to the next free element inside the receive buffer of the UART. More... | |
static uint8_t | sio_rx_state [NUM_TRX] |
This is the receiver state of the UART. More... | |
static uint8_t | sio_rx_length [NUM_TRX] |
This is the transmit state of the UART. More... | |
static uint8_t | data [NUM_TRX][SIO_RX_BUF_SIZE] |
This is the buffer to hold the frame received through serial interface. More... | |
static uint8_t | data_length [NUM_TRX] = {0, 0} |
This is length variable to keep track of no of received bytes. More... | |
static uint8_t | rx_index [NUM_TRX] = {0, 0} |
This is index used to validate the received bytes based on their position. More... | |
static uint8_t | head [NUM_TRX] = {0, 0} |
This is head of the queue of buffers to be transmitted. More... | |
static uint8_t | buf_count [NUM_TRX] = {0, 0} |
This is buffer count to keep track of the available bufer for transmission. More... | |
uint32_t | rcvd_channel_mask [NUM_TRX] = {0, 0} |
static uint8_t | curr_tx_buffer_index [NUM_TRX] = {0, 0} |
static void | process_incoming_sio_data (trx_id_t trx) |
Process data received from SIO. More... | |
static uint8_t * | get_next_tx_buffer (trx_id_t trx) |
get the new buffer for next transmission through serial More... | |
static void | handle_incoming_msg (trx_id_t trx) |
Parses the Received Data in the Buffer and Process the Commands accordingly. More... | |
void | init_sio (trx_id_t trx) |
This function does the initialization of the Serial handler state Machine. More... | |
void | serial_data_handler (void) |
Function to handle the state machine serial data exchange. More... | |
void | usr_perf_start_confirm (trx_id_t trx, uint8_t status, uint8_t start_mode, trx_config_params_t *trx_config_params, uint8_t peer_ic_type, char *peer_soc_mcu_name, char *peer_trx_name, char *peer_board_name, uint64_t peer_mac_address, float peer_fw_version, uint32_t peer_feature_mask) |
Function to generate Perf Start confirmation frame that must be sent to host application via serial interface. More... | |
void | usr_per_test_start_confirm (trx_id_t trx, uint8_t status) |
Function to generate Per Test Start confirmation frame that must be sent to host application via serial interface. More... | |
void | usr_range_test_beacon_tx (trx_id_t trx, frame_info_t *frame) |
Function to send the transmitted frame to the Host application. More... | |
void | usr_range_test_beacon_rsp (trx_id_t trx, frame_info_t *frame, uint8_t lqi_h, int8_t ed_h, uint8_t lqi_r, int8_t ed_r) |
Function to send the Received Range Test Response frame to the Host application. More... | |
void | usr_range_test_marker_ind (trx_id_t trx, frame_info_t *frame, uint8_t lqi, int8_t ed_value) |
Function to send the Marker Indication frame to the Host application. More... | |
void | usr_range_test_start_confirm (trx_id_t trx, uint8_t status) |
Function to generate Range Test Start confirmation frame that must be sent to host application via serial interface. More... | |
void | usr_range_test_stop_confirm (trx_id_t trx, uint8_t status) |
Function to generate Range Test Stop confirmation frame that must be sent to host application via serial interface. More... | |
void | usr_perf_set_confirm (trx_id_t trx, uint8_t status, uint8_t param_type, param_value_t *param_value) |
Function to generate Perf Set confirmation frame that must be sent to host application via serial interface. More... | |
void | usr_perf_get_confirm (trx_id_t trx, uint8_t status, uint8_t parameter_type, param_value_t *parame_value) |
Function to generate Perf Get confirmation frame that must be sent to host application via serial interface. More... | |
void | usr_identify_peer_node_confirm (trx_id_t trx, uint8_t status) |
Function to generate Identify_peer_cnode_confirm that must be sent to host application via serial interface. More... | |
void | usr_cont_pulse_tx_confirm (trx_id_t trx, uint8_t status) |
Function to generate cont_pulse_tx_confirm that must be sent to host application via serial interface. More... | |
void | usr_cont_wave_tx_confirm (trx_id_t trx, uint8_t status, bool start_stop_param, uint8_t tx_mode) |
Function to generate cont_wave_tx_confirm that must be sent to host application via serial interface. More... | |
void | usr_register_read_confirm (trx_id_t trx, uint8_t status, uint16_t reg_addr, uint8_t reg_val) |
Function to generate usr_register_read_confirm that must be sent to host application via serial interface. More... | |
void | usr_register_write_confirm (trx_id_t trx, uint8_t status, uint16_t reg_addr, uint8_t reg_val) |
Function to generate usr_register_write_confirm that must be sent to host application via serial interface. More... | |
void | usr_register_dump_confirm (trx_id_t trx, uint8_t status, uint16_t start_reg_addr, uint16_t end_reg_addr, uint8_t *reg_val) |
Function to generate usr_register_dump_confirm that must be sent to host application via serial interface. More... | |
void | usr_per_test_end_indication (trx_id_t trx, uint8_t status, int8_t rssi_val, uint8_t aver_lqi, uint32_t frames_transmitted, uint32_t frames_received, uint32_t frames_failure, uint32_t frames_no_ack, uint32_t frames_channel_access_failure, uint32_t frames_with_wrong_crc, float test_duration_sec, float test_net_data_rate) |
Function to generate Per test End Indication frame that must be sent to host application via serial interface. More... | |
void | usr_ed_scan_start_confirm (trx_id_t trx, uint8_t status, uint8_t scan_time_min, float scan_time_sec) |
Function to generate ED scan confirm test End Indication frame that must be sent to host application via serial interface. More... | |
void | usr_ed_scan_end_indication (trx_id_t trx, uint8_t no_of_channels, ed_scan_result_t *ed_scan_result) |
Function to generate ED scan Indication frame that must be sent to host application via serial interface. More... | |
void | usr_sensor_data_get_confirm (trx_id_t trx, uint8_t status, float bat_voltage, float temperature) |
Function to generate Sensor data confirm frame that must be sent to host application via serial interface. More... | |
void | usr_peer_disconnect_confirm (trx_id_t trx, uint8_t status) |
Function to generate Disconnect Confirm frame that must be sent to host application via serial interface. More... | |
void | usr_set_default_config_confirm (trx_id_t trx, uint8_t status, trx_config_params_t *default_trx_config_params) |
Function to generate Set default config Confirm frame that must be sent to host application via serial interface. More... | |
void | usr_identify_board_confirm (trx_id_t trx, uint8_t status, uint8_t ic_type, const char *mcu_soc_name, const char *trx_name, const char *board_name, uint64_t mac_address, float fw_version, uint32_t fw_feature_mask) |
Function to generate Identify Board confirm frame that must be sent to host application via serial interface. More... | |
void | usr_get_current_config_confirm (trx_id_t trx, uint8_t status, trx_config_params_t *curr_trx_conf_params) |
Function to generate Get Current config Confirm frame that must be sent to host application via serial interface. More... | |
#define | SOT (1) |
The start of transmission delimiter. More... | |
#define | EOT (4) |
The end of transmission delimiter. More... | |
#define | UART_RX_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character. More... | |
#define | UART_RX_STATE_LENGTH (2) |
A UART state that expects the length to be received as the next character. More... | |
#define | UART_RX_STATE_DATA (3) |
A UART state that expects the next data character to be received. More... | |
#define | UART_RX_STATE_EOT (4) |
A UART state that expects a EOT to be received as the next character. More... | |
#define | SIO_BUF_COUNT (3) |
#define | SIO_RX_BUF_SIZE (32) |
#define | SIO_TX_BUF_SIZE (156) |
Functions for User Request Primitives | |
void | perf_set_req (trx_id_t trx, uint8_t set_param_type, param_value_t *param_value) |
void | perf_set_sun_page (trx_id_t trx, uint8_t *sun_page) |
void | perf_get_req (trx_id_t trx, uint8_t param_type) |
Function to get the various configuration parameters for PER Test. More... | |
void | initiate_per_test (trx_id_t trx) |
Initiates the test procedure. More... | |
void | start_ed_scan (trx_id_t trx, uint8_t scan_duration, uint32_t channel_sel_mask) |
Function to start the ED scan. More... | |
void | get_sensor_data (trx_id_t trx) |
Function to get the Sensor data like Battery volatge. More... | |
void | get_board_details (trx_id_t trx) |
prints the hardware details More... | |
void | identify_peer_node (trx_id_t trx) |
Identifying peer node. More... | |
void | read_trx_registers (trx_id_t trx, uint16_t reg_addr) |
Read transceiver register. More... | |
void | write_trx_registers (trx_id_t trx, uint16_t reg_addr, uint8_t reg_val) |
write Transceiver registers 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... | |
void | disconnect_peer_node (trx_id_t trx) |
Function to request the peer to get disconnected from source node. More... | |
void | set_default_configuration (trx_id_t trx) |
Function to set the default values of. More... | |
void | get_current_configuration (trx_id_t trx) |
Function to get the current values of the all configurabel patameters. More... | |
uint8_t | check_error_conditions (trx_id_t trx) |
Function used to check the error conditions before. More... | |
uint8_t | get_param_length (uint8_t parameter_type) |
Functions for User Confirm/Indication Messages generated in response | |
void | initiate_range_test (trx_id_t trx) |
Initiates the Range test procedure. More... | |
void | stop_range_test (trx_id_t trx) |
Function to Stop the range Test in PER Mode. More... | |
float | reverse_float (const float float_val) |
The reverse_float is used for reversing a float variable for supporting BIG ENDIAN systems. More... | |
Error Codes | |
#define | INVALID_CMD (0x20) |
#define | ED_SCAN_UNDER_PROGRESS (0x21) |
#define | TRANSMISSION_UNDER_PROGRESS (0x22) |
#define | CW_TRANSMISSION_UNDER_PROGRESS (0x23) |
#define | NO_PEER_FOUND (0x24) |
#define | UNABLE_TO_CONTACT_PEER (0x25) |
#define | INVALID_ARGUMENT (0x26) |
#define | VALUE_OUT_OF_RANGE (0x27) |
#define | INVALID_REGISTER_ORDER (0x28) |
#define | TRANSCEIVER_IN_SLEEP (0x29) |
#define | TRANSMISSION_FAILURE (0x30) |
#define | RANGE_TEST_IN_PROGRESS (0x31) |
Parameter Identifiers | |
#define | PARAM_CHANNEL (0x00) |
#define | PARAM_CHANNEL_PAGE (0x01) |
#define | PARAM_TX_POWER_DBM (0x03) |
#define | PARAM_CSMA (0x04) |
#define | PARAM_FRAME_RETRY (0x05) |
#define | PARAM_ACK_REQUEST (0x06) |
#define | PARAM_ANT_DIVERSITY (0x07) |
#define | PARAM_ANT_DIVERSITY_ON_PEER (0x08) |
#define | PARAM_DESENSITIZATION (0x09) |
#define | PARAM_TRX_STATE (0x0a) |
#define | PARAM_CRC_ON_PEER (0x0b) |
#define | PARAM_NO_OF_TEST_FRAMES (0x0c) |
#define | PARAM_PHY_FRAME_LENGTH (0x0d) |
#define | PARAM_RPC (0x0e) |
#define | PARAM_ISM_FREQUENCY (0x0f) |
MACROS to set the specific features supported | |
#define | MULTI_CHANNEL_SELECT ((uint32_t)(1) << 0) |
#define | PER_RANGE_TEST_MODE ((uint32_t)(1) << 1) |
Generic | |
#define | FIELD_DOES_NOT_EXIST (0xFF) |
#define | BYTE_LEN (0x08) |
#define | NUL_VAL (0) |
#define | START_MODE_PER (1) |
#define | START_MODE_SINGLE_NODE (2) |
#define | RESULT_SIZE_PER_CHANNEL (2) |
#define | START_CWT (1) |
#define | STOP_CWT (0) |
#define | TX_POWER_FORMAT_REG (0) |
#define | TX_POWER_FORMAT_DBM (1) |
#define | MESSAGE_ID_POS (2) |
#define | PARAM_TYPE_POS (3) |
#define | PARAM_LEN_POS (4) |
#define | PARAM_VALUE_POS (5) |
#define | START_MODE_POS (3) |
#define | START_STOP_POS (3) |
#define | TX_MODE_POS (4) |
#define | REGISTER_ADDR_POS (3) |
#define | REGISTER_VAL_POS (5) |
#define | START_REG_ADDR_POS (3) |
#define | END_REG_ADDR_POS (5) |
#define | MSG_LEN_ED_SCAN_POS (0) |
#define | SCAN_DURATION_POS (3) |
#define | CHANNELS_SELECT_POS (4) |
#define | MSG_LEN_ED_SCAN_REQ (7) |
#define BYTE_LEN (0x08) |
Referenced by usr_register_dump_confirm(), usr_register_read_confirm(), and usr_register_write_confirm().
#define CHANNELS_SELECT_POS (4) |
Referenced by handle_incoming_msg().
#define CONT_PULSE_TX_CONFIRM_LEN (2) |
Referenced by usr_cont_pulse_tx_confirm().
#define CONT_WAVE_TX_CONFIRM_LEN (4) |
Referenced by usr_cont_wave_tx_confirm().
#define CW_TRANSMISSION_UNDER_PROGRESS (0x23) |
Referenced by check_error_conditions(), and handle_incoming_msg().
#define ED_SCAN_END_INDICATION_LEN (2) |
Referenced by usr_ed_scan_end_indication().
#define ED_SCAN_START_CONFIRM_LEN (7) |
Referenced by usr_ed_scan_start_confirm().
#define ED_SCAN_UNDER_PROGRESS (0x21) |
Referenced by check_error_conditions().
#define END_REG_ADDR_POS (5) |
Referenced by handle_incoming_msg().
#define EOT (4) |
The end of transmission delimiter.
Referenced by process_incoming_sio_data(), usr_cont_pulse_tx_confirm(), usr_cont_wave_tx_confirm(), usr_ed_scan_end_indication(), usr_ed_scan_start_confirm(), usr_get_current_config_confirm(), usr_identify_board_confirm(), usr_identify_peer_node_confirm(), usr_peer_disconnect_confirm(), usr_per_test_end_indication(), usr_per_test_start_confirm(), usr_perf_get_confirm(), usr_perf_set_confirm(), usr_perf_start_confirm(), usr_range_test_beacon_rsp(), usr_range_test_beacon_tx(), usr_range_test_marker_ind(), usr_range_test_start_confirm(), usr_range_test_stop_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_sensor_data_get_confirm(), and usr_set_default_config_confirm().
#define FIELD_DOES_NOT_EXIST (0xFF) |
Referenced by usr_get_current_config_confirm(), usr_perf_start_confirm(), and usr_set_default_config_confirm().
#define GET_CURRENT_CONFIG_CONFIRM_LEN (25) |
Referenced by usr_get_current_config_confirm().
#define IDENTIFY_BOARD_CONFIRM_LEN (19) |
Referenced by usr_identify_board_confirm().
#define IDENTIFY_PEER_NODE_CONFIRM_LEN (2) |
Referenced by usr_identify_peer_node_confirm().
#define INVALID_ARGUMENT (0x26) |
Referenced by handle_incoming_msg(), perf_get_req(), perf_set_req(), and start_cw_transmission().
#define INVALID_CMD (0x20) |
Referenced by config_crc_peer_node(), handle_incoming_msg(), initiate_per_test(), initiate_range_test(), start_test(), and stop_range_test().
#define INVALID_REGISTER_ORDER (0x28) |
Referenced by dump_trx_register_values().
#define MESSAGE_ID_POS (2) |
Referenced by handle_incoming_msg().
#define MSG_LEN_ED_SCAN_POS (0) |
Referenced by handle_incoming_msg().
#define MSG_LEN_ED_SCAN_REQ (7) |
Referenced by handle_incoming_msg().
#define MULTI_CHANNEL_SELECT ((uint32_t)(1) << 0) |
Referenced by get_board_details(), and get_node_info().
#define NO_PEER_FOUND (0x24) |
Referenced by peer_rsp_rcvd_init(), peer_rsp_rcvd_tx_cb(), and wait_for_reply_timer_handler_cb().
#define NUL_VAL (0) |
#define OCTET_STR_LEN_BYTE_LEN (1) |
Referenced by usr_identify_board_confirm(), usr_perf_get_confirm(), and usr_perf_set_confirm().
#define PARAM_ACK_REQUEST (0x06) |
Referenced by config_ack_request(), perf_get_req(), and perf_set_req().
#define PARAM_ANT_DIVERSITY (0x07) |
#define PARAM_ANT_DIVERSITY_ON_PEER (0x08) |
#define PARAM_CHANNEL (0x00) |
Referenced by perf_get_req(), perf_set_req(), set_channel_app(), and set_parameter_on_transmitter_node().
#define PARAM_CHANNEL_PAGE (0x01) |
#define PARAM_CRC_ON_PEER (0x0b) |
#define PARAM_CSMA (0x04) |
Referenced by config_csma(), perf_get_req(), and perf_set_req().
#define PARAM_DESENSITIZATION (0x09) |
Referenced by config_rx_desensitization(), perf_get_req(), and perf_set_req().
#define PARAM_FRAME_RETRY (0x05) |
Referenced by config_frame_retry(), perf_get_req(), and perf_set_req().
#define PARAM_ISM_FREQUENCY (0x0f) |
Referenced by perf_get_req(), and perf_set_req().
#define PARAM_LEN_POS (4) |
Referenced by handle_incoming_msg().
#define PARAM_NO_OF_TEST_FRAMES (0x0c) |
Referenced by perf_get_req(), and perf_set_req().
#define PARAM_PHY_FRAME_LENGTH (0x0d) |
Referenced by perf_get_req(), perf_set_req(), and set_phy_frame_length().
#define PARAM_RPC (0x0e) |
Referenced by perf_get_req(), and perf_set_req().
#define PARAM_TRX_STATE (0x0a) |
Referenced by handle_incoming_msg(), perf_get_req(), perf_set_req(), and set_transceiver_state().
#define PARAM_TX_POWER_DBM (0x03) |
Referenced by perf_get_req(), perf_set_req(), set_parameter_on_transmitter_node(), and set_tx_power().
#define PARAM_TYPE_POS (3) |
Referenced by handle_incoming_msg().
#define PARAM_VALUE_POS (5) |
Referenced by handle_incoming_msg().
#define PEER_DISCONNECT_CONFIRM_LEN (2) |
Referenced by usr_peer_disconnect_confirm().
#define PER_RANGE_TEST_MODE ((uint32_t)(1) << 1) |
Referenced by get_board_details(), and get_node_info().
#define PER_TEST_END_INDICATION_LEN (36) |
Referenced by usr_per_test_end_indication().
#define PER_TEST_START_CONFIRM_LEN (2) |
Referenced by usr_per_test_start_confirm().
#define PERF_GET_CONFIRM_LEN (3) |
Referenced by usr_perf_get_confirm().
#define PERF_SET_CONFIRM_LEN (3) |
Referenced by usr_perf_set_confirm().
#define PERF_START_CONFIRM_LEN (31) |
Referenced by usr_perf_start_confirm().
#define PROTOCOL_ID |
This indicates the PROTOCOL_ID field in the Serial Parser frame format.
Referenced by handle_incoming_msg(), usr_cont_pulse_tx_confirm(), usr_cont_wave_tx_confirm(), usr_ed_scan_end_indication(), usr_ed_scan_start_confirm(), usr_get_current_config_confirm(), usr_identify_board_confirm(), usr_identify_peer_node_confirm(), usr_peer_disconnect_confirm(), usr_per_test_end_indication(), usr_per_test_start_confirm(), usr_perf_get_confirm(), usr_perf_set_confirm(), usr_perf_start_confirm(), usr_range_test_beacon_rsp(), usr_range_test_beacon_tx(), usr_range_test_marker_ind(), usr_range_test_start_confirm(), usr_range_test_stop_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_sensor_data_get_confirm(), and usr_set_default_config_confirm().
#define PROTOCOL_ID_LEN (1) |
Referenced by usr_cont_pulse_tx_confirm(), usr_cont_wave_tx_confirm(), usr_ed_scan_end_indication(), usr_ed_scan_start_confirm(), usr_get_current_config_confirm(), usr_identify_board_confirm(), usr_identify_peer_node_confirm(), usr_peer_disconnect_confirm(), usr_per_test_end_indication(), usr_per_test_start_confirm(), usr_perf_get_confirm(), usr_perf_set_confirm(), usr_perf_start_confirm(), usr_range_test_beacon_rsp(), usr_range_test_beacon_tx(), usr_range_test_marker_ind(), usr_range_test_start_confirm(), usr_range_test_stop_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_sensor_data_get_confirm(), and usr_set_default_config_confirm().
#define RANGE_MEASURE_STATS_CONFIRM (10) |
#define RANGE_TEST_IN_PROGRESS (0x31) |
Referenced by check_error_conditions().
#define RANGE_TEST_MARKER_IND_LEN (3) /*Excluding ota packet*/ |
Referenced by usr_range_test_marker_ind().
#define RANGE_TEST_RSP_PKT_LEN (5) /*Excluding ota packet*/ |
Referenced by usr_range_test_beacon_rsp().
#define RANGE_TEST_START_CONFIRM_LEN (2) |
Referenced by usr_range_test_start_confirm(), and usr_range_test_stop_confirm().
#define RANGE_TEST_STOP_CONFIRM_LEN (2) |
#define REGISTER_ADDR_POS (3) |
Referenced by handle_incoming_msg().
#define REGISTER_DUMP_CONFIRM_LEN (6) |
Referenced by usr_register_dump_confirm().
#define REGISTER_READ_CONFIRM_LEN (5) |
Referenced by usr_register_read_confirm().
#define REGISTER_VAL_POS (5) |
Referenced by handle_incoming_msg().
#define REGISTER_WRITE_CONFIRM_LEN (5) |
Referenced by usr_register_write_confirm().
#define RESULT_SIZE_PER_CHANNEL (2) |
Referenced by usr_ed_scan_end_indication().
#define SCAN_DURATION_POS (3) |
Referenced by handle_incoming_msg().
#define SENSOR_DATA_CONFIRM_LEN (10) |
Referenced by usr_sensor_data_get_confirm().
#define SET_DEFAULT_CONFIG_CONFIRM_LEN (22) |
Referenced by usr_set_default_config_confirm().
#define SIO_BUF_COUNT (3) |
Referenced by get_next_tx_buffer(), and serial_data_handler().
#define SIO_RX_BUF_SIZE (32) |
Referenced by serial_data_handler().
#define SIO_TX_BUF_SIZE (156) |
#define SOT (1) |
The start of transmission delimiter.
Referenced by get_next_tx_buffer(), and process_incoming_sio_data().
#define START_CWT (1) |
Referenced by handle_incoming_msg(), and start_cw_transmission().
#define START_MODE_PER (1) |
#define START_MODE_POS (3) |
Referenced by handle_incoming_msg().
#define START_MODE_SINGLE_NODE (2) |
Referenced by handle_incoming_msg(), and per_mode_initiator_init().
#define START_REG_ADDR_POS (3) |
Referenced by handle_incoming_msg().
#define START_STOP_POS (3) |
Referenced by handle_incoming_msg().
#define STOP_CWT (0) |
Referenced by handle_incoming_msg(), and stop_cw_transmission().
#define TRANSCEIVER_IN_SLEEP (0x29) |
Referenced by check_error_conditions(), handle_incoming_msg(), and set_transceiver_state().
#define TRANSMISSION_FAILURE (0x30) |
Referenced by config_crc_peer_node(), disconnect_peer_node(), identify_peer_node(), and set_default_configuration().
#define TRANSMISSION_UNDER_PROGRESS (0x22) |
Referenced by check_error_conditions().
#define TX_MODE_POS (4) |
Referenced by handle_incoming_msg().
#define TX_POWER_FORMAT_DBM (1) |
Referenced by set_tx_power().
#define TX_POWER_FORMAT_REG (0) |
Referenced by set_tx_power().
#define UART_RX_STATE_DATA (3) |
A UART state that expects the next data character to be received.
Referenced by process_incoming_sio_data().
#define UART_RX_STATE_EOT (4) |
A UART state that expects a EOT to be received as the next character.
Referenced by process_incoming_sio_data().
#define UART_RX_STATE_LENGTH (2) |
A UART state that expects the length to be received as the next character.
Referenced by process_incoming_sio_data().
#define UART_RX_STATE_SOT (1) |
A UART state that expects a SOT to be received as the next character.
Referenced by init_sio(), and process_incoming_sio_data().
#define UNABLE_TO_CONTACT_PEER (0x25) |
#define VALUE_OUT_OF_RANGE (0x27) |
enum msg_code |
uint8_t check_error_conditions | ( | trx_id_t | trx | ) |
Function used to check the error conditions before.
processing the received command
Function used to check the error conditions before.
processing the received command
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().
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.
start_reg_addr | The start address of the group of registers to be read |
end_reg_addr | The 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().
void get_board_details | ( | trx_id_t | trx | ) |
prints the hardware details
References BOARD_NAME, FIRMWARE_VERSION, fw_feature_mask, IC_TYPE, MAC_SUCCESS, MCU_SOC_NAME, MULTI_CHANNEL_SELECT, PER_RANGE_TEST_MODE, reverse_float(), RF24, tal_pib, and usr_identify_board_confirm().
Referenced by handle_incoming_msg().
void get_current_configuration | ( | trx_id_t | trx | ) |
Function to get the current values of the all configurabel patameters.
in the Performance Anlayzer application
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().
|
static |
get the new buffer for next transmission through serial
References buf_count, head, SIO_BUF_COUNT, sio_tx_buf, and SOT.
Referenced by usr_cont_pulse_tx_confirm(), usr_cont_wave_tx_confirm(), usr_ed_scan_end_indication(), usr_ed_scan_start_confirm(), usr_get_current_config_confirm(), usr_identify_board_confirm(), usr_identify_peer_node_confirm(), usr_peer_disconnect_confirm(), usr_per_test_end_indication(), usr_per_test_start_confirm(), usr_perf_get_confirm(), usr_perf_set_confirm(), usr_perf_start_confirm(), usr_range_test_beacon_rsp(), usr_range_test_beacon_tx(), usr_range_test_marker_ind(), usr_range_test_start_confirm(), usr_range_test_stop_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_sensor_data_get_confirm(), and usr_set_default_config_confirm().
uint8_t get_param_length | ( | uint8_t | parameter_type | ) |
References PGM_READ_BYTE.
Referenced by usr_perf_get_confirm(), and usr_perf_set_confirm().
void get_sensor_data | ( | trx_id_t | trx | ) |
Function to get the Sensor data like Battery volatge.
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().
|
inlinestatic |
Parses the Received Data in the Buffer and Process the Commands accordingly.
References CH_PG_SUN, CHANNELS_SELECT_POS, check_error_conditions(), CONT_PULSE_TX_REQ, CONT_WAVE_TX_REQ, CW_TRANSMISSION_UNDER_PROGRESS, disconnect_peer_node(), dump_trx_register_values(), ED_SCAN_START_REQ, END_REG_ADDR_POS, get_board_details(), GET_CURRENT_CONFIG_REQ, get_current_configuration(), get_sensor_data(), IDENTIFY_BOARD_REQ, identify_peer_node(), IDENTIFY_PEER_NODE_REQ, initiate_per_test(), initiate_range_test(), INVALID_ARGUMENT, INVALID_CMD, MAC_SUCCESS, MEMCPY_ENDIAN, MESSAGE_ID_POS, MSG_LEN_ED_SCAN_POS, MSG_LEN_ED_SCAN_REQ, node_info, NUL_VAL, PARAM_CHANNEL_PAGE, PARAM_LEN_POS, PARAM_TRX_STATE, PARAM_TYPE_POS, param_value_t::param_value_8bit, PARAM_VALUE_POS, PEER_DISCONNECT_REQ, PEER_SEARCH_PER_RX, PEER_SEARCH_PER_TX, PEER_SEARCH_RANGE_RX, PEER_SEARCH_RANGE_TX, PER_TEST_INITIATOR, PER_TEST_RECEPTOR, PER_TEST_START_REQ, PERF_GET_REQ, perf_get_req(), PERF_SET_REQ, perf_set_req(), perf_set_sun_page(), PERF_START_REQ, PROTOCOL_ID, pulse_cw_transmission(), RANGE_TEST_START_REQ, RANGE_TEST_STOP_REQ, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, rcvd_channel_mask, read_trx_registers(), REGISTER_ADDR_POS, REGISTER_DUMP_REQ, REGISTER_READ_REQ, REGISTER_VAL_POS, REGISTER_WRITE_REQ, SCAN_DURATION_POS, SENSOR_DATA_REQ, SET_DEFAULT_CONFIG_REQ, set_default_configuration(), set_main_state(), SINGLE_NODE_TESTS, sio_rx_buf, start_cw_transmission(), START_CWT, start_ed_scan(), START_MODE_PER, START_MODE_POS, START_MODE_SINGLE_NODE, START_REG_ADDR_POS, START_STOP_POS, stop_cw_transmission(), STOP_CWT, stop_range_test(), tal_pib, TRANSCEIVER_IN_SLEEP, TRX_SLEEP, TRX_SUPPORTED_CHANNELS_LEG, TX_MODE_POS, usr_cont_pulse_tx_confirm(), usr_cont_wave_tx_confirm(), usr_ed_scan_start_confirm(), usr_get_current_config_confirm(), usr_identify_peer_node_confirm(), usr_peer_disconnect_confirm(), usr_per_test_start_confirm(), usr_perf_get_confirm(), usr_perf_set_confirm(), usr_perf_start_confirm(), usr_range_test_start_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_sensor_data_get_confirm(), usr_set_default_config_confirm(), WAIT_FOR_EVENT, and write_trx_registers().
Referenced by process_incoming_sio_data().
void identify_peer_node | ( | trx_id_t | trx | ) |
Identifying peer node.
References IDENTIFY_PEER, op_mode, send_identify_command(), TRANSMISSION_FAILURE, TX_OP_MODE, and usr_identify_peer_node_confirm().
Referenced by handle_incoming_msg().
void init_sio | ( | trx_id_t | trx | ) |
This function does the initialization of the Serial handler state Machine.
References sio_rx_state, and UART_RX_STATE_SOT.
Referenced by init_after_disconnect(), and init_state_init().
void initiate_per_test | ( | trx_id_t | trx | ) |
Initiates the test procedure.
References INVALID_CMD, op_mode, PER_TEST_START, send_per_test_start_cmd(), TX_OP_MODE, UNABLE_TO_CONTACT_PEER, and usr_per_test_start_confirm().
Referenced by handle_incoming_msg().
void initiate_range_test | ( | trx_id_t | trx | ) |
Initiates the Range test procedure.
References INVALID_CMD, op_mode, RANGE_TEST_START, send_range_test_start_cmd(), TX_OP_MODE, and usr_range_test_start_confirm().
Referenced by handle_incoming_msg().
void perf_get_req | ( | trx_id_t | trx, |
uint8_t | param_type | ||
) |
Function to get the various configuration parameters for PER Test.
param_type | Parameter type to be read |
References fsk_tag::bt, CH_PG_SUN, oqpsk_tag::chip_rate, leg_oqpsk_tag::chip_rate, leg_oqpsk_tag::data_rate, fsk_tag::fec_enabled, phy_tag::freq_band, FSK, phy_mode_tag::fsk, get_crc_settings_peer_node(), ofdm_tag::interl, INVALID_ARGUMENT, LEG_OQPSK, phy_mode_tag::leg_oqpsk, MAC_SUCCESS, ofdm_tag::mcs_val, fsk_tag::mod_idx, fsk_tag::mod_type, phy_tag::modulation, OFDM, phy_mode_tag::ofdm, fsk_tag::op_mode, ofdm_tag::option, OQPSK, phy_mode_tag::oqpsk, PARAM_ACK_REQUEST, PARAM_CHANNEL, PARAM_CHANNEL_PAGE, PARAM_CRC_ON_PEER, PARAM_CSMA, PARAM_DESENSITIZATION, PARAM_FRAME_RETRY, PARAM_ISM_FREQUENCY, PARAM_NO_OF_TEST_FRAMES, PARAM_PHY_FRAME_LENGTH, PARAM_RPC, PARAM_TRX_STATE, PARAM_TX_POWER_DBM, phy_tag::phy_mode, phyCurrentChannel, phyCurrentPage, phySetting, phyTransmitPower, oqpsk_tag::rate_mode, fsk_tag::sym_rate, tal_get_curr_trx_config(), tal_get_trx_status(), tal_pib_get(), TX_PWR, and usr_perf_get_confirm().
Referenced by handle_incoming_msg().
void perf_set_req | ( | trx_id_t | trx, |
uint8_t | set_param_type, | ||
param_value_t * | param_value | ||
) |
Function to set the various configuration parameters for PER Test
param_type | Parameter type to be set |
param_value | Pointer to the parameter value to be set |
References config_ack_request(), config_crc_peer_node(), config_csma(), config_frame_retry(), config_rx_desensitization(), INVALID_ARGUMENT, last_tx_power_format_set, MAC_SUCCESS, MEMCPY_ENDIAN, NUL_VAL, trx_config_params_t::number_test_frames, PARAM_ACK_REQUEST, PARAM_CHANNEL, PARAM_CHANNEL_PAGE, PARAM_CRC_ON_PEER, PARAM_CSMA, PARAM_DESENSITIZATION, PARAM_FRAME_RETRY, PARAM_ISM_FREQUENCY, PARAM_NO_OF_TEST_FRAMES, PARAM_PHY_FRAME_LENGTH, PARAM_RPC, PARAM_TRX_STATE, PARAM_TX_POWER_DBM, param_value_t::param_value_16bit, param_value_t::param_value_32bit, param_value_t::param_value_8bit, param_value_t::param_value_bool, set_channel_app(), set_channel_page(), set_phy_frame_length(), set_transceiver_state(), set_tx_power(), usr_perf_set_confirm(), and VALUE_OUT_OF_RANGE.
Referenced by handle_incoming_msg().
void perf_set_sun_page | ( | trx_id_t | trx, |
uint8_t * | param_val | ||
) |
Function to set the various configuration parameters in SUN PAGE for PER Test
sun_page | Pointer to the configurable parameter value structure |
References fsk_tag::bt, CH_PG_SUN, phy_tag::ch_spacing, trx_config_params_t::channel, trx_config_params_t::channel_page, CHINA_470, oqpsk_tag::chip_rate, leg_oqpsk_tag::chip_rate, CHIP_RATE_2000, leg_oqpsk_tag::data_rate, fsk_tag::fec_enabled, phy_tag::freq_band, sun_phy_tag::freq_band, phy_tag::freq_f0, FSK, phy_mode_tag::fsk, FSK_OP_MOD_3, get_fsk_freq_f0(), get_leg_oqpsk_freq_f0(), get_ofdm_freq_f0(), get_oqpsk_freq_f0(), ofdm_tag::interl, INVALID_VALUE, JAPAN_920, LEG_OQPSK, phy_mode_tag::leg_oqpsk, sun_phy_mode_tag::leg_oqpsk, MAC_SUCCESS, MCS1, MCS2, MCS6, ofdm_tag::mcs_val, fsk_tag::mod_idx, fsk_tag::mod_type, phy_tag::modulation, sun_phy_tag::modulation, sun_phy_mode_tag::mr_fsk, sun_phy_mode_tag::mr_ofdm, sun_phy_mode_tag::mr_oqpsk, OFDM, phy_mode_tag::ofdm, OFDM_OPT_3, OFDM_OPT_4, fsk_tag::op_mode, ofdm_tag::option, OQPSK, phy_mode_tag::oqpsk, OQPSK_DATA_RATE_1000, OQPSK_DATA_RATE_250, OQPSK_RATE_MOD_3, OQPSK_RATE_MOD_4, sun_phy_tag::page_no, PARAM_CHANNEL_PAGE, peer_found, phy_tag::phy_mode, phyCurrentChannel, phyFSKFECEnabled, phyHighRateEnabled, phyOFDMMCS, phyOQPSKRateMode, phySetting, oqpsk_tag::rate_mode, send_sun_page_changed(), sun_page_param_val, sun_phy_tag::sun_phy_mode, fsk_tag::sym_rate, tal_pib, tal_pib_get(), tal_pib_set(), and usr_perf_set_confirm().
Referenced by handle_incoming_msg().
|
inlinestatic |
Process data received from SIO.
References data, EOT, handle_incoming_msg(), rx_index, sio_rx_buf, sio_rx_length, sio_rx_ptr, sio_rx_state, SOT, UART_RX_STATE_DATA, UART_RX_STATE_EOT, UART_RX_STATE_LENGTH, and UART_RX_STATE_SOT.
Referenced by serial_data_handler().
void read_trx_registers | ( | trx_id_t | trx, |
uint16_t | reg_addr | ||
) |
Read transceiver register.
reg_addr | The 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().
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().
void serial_data_handler | ( | void | ) |
Function to handle the state machine serial data exchange.
References buf_count, curr_tx_buffer_index, data, data_length, head, node_info, process_incoming_sio_data(), RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, rx_index, sio2host_rx(), sio2host_tx(), sio2ncp_rx(), sio2ncp_tx(), SIO_BUF_COUNT, SIO_RX_BUF_SIZE, and sio_tx_buf.
Referenced by performance_analyzer_task().
void set_default_configuration | ( | trx_id_t | trx | ) |
Function to set the default values of.
all configurable paramters 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().
void sio_write | ( | uint8_t * | message | ) |
Function to write messages into UART/USB, used to send assert messages.
void start_ed_scan | ( | trx_id_t | trx, |
uint8_t | ed_scan_duration, | ||
uint32_t | channel_sel_mask | ||
) |
Function to start the ED scan.
scan_duration | paramter which is used to calculate the scan time on each channel |
Function to start the ED scan.
ed_scan_duration | Scan 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_range_test | ( | trx_id_t | trx | ) |
Function to Stop the range Test in PER Mode.
References INVALID_CMD, op_mode, range_test_in_progress, RANGE_TEST_STOP, RANGE_TEST_TX, send_range_test_stop_cmd(), and usr_range_test_start_confirm().
Referenced by handle_incoming_msg().
void usr_cont_pulse_tx_confirm | ( | trx_id_t | trx, |
uint8_t | status | ||
) |
Function to generate cont_pulse_tx_confirm that must be sent to host application via serial interface.
Called by Performance application as reply to the cont_pulse_tx_req
status | Result for cont_pulse_tx_req |
References CONT_PULSE_TX_CONFIRM, CONT_PULSE_TX_CONFIRM_LEN, EOT, get_next_tx_buffer(), PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by handle_incoming_msg(), and stop_pulse_cb().
void usr_cont_wave_tx_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
bool | start_stop_param, | ||
uint8_t | tx_mode | ||
) |
Function to generate cont_wave_tx_confirm that must be sent to host application via serial interface.
Called by Performance application as reply to the cont_wave_tx_req
status | Result for cont_wave_tx_req |
start_stop_param | Parameter to start or stop cont tx |
tx_mode | Indicates CW or PRBS |
References CONT_WAVE_TX_CONFIRM, CONT_WAVE_TX_CONFIRM_LEN, EOT, get_next_tx_buffer(), PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by handle_incoming_msg(), start_cw_transmission(), and stop_cw_transmission().
void usr_ed_scan_end_indication | ( | trx_id_t | trx, |
uint8_t | no_of_channels, | ||
ed_scan_result_t * | ed_scan_result | ||
) |
Function to generate ED scan Indication frame that must be sent to host application via serial interface.
Called by Performance application as Indication after completion of the ED scan
no_of_channels | No. of channels scanned |
ed_scan_result | List of Energy values along with the channel numbers |
References ed_scan_result_t::channel_no, ED_SCAN_END_INDICATION, ED_SCAN_END_INDICATION_LEN, EOT, get_next_tx_buffer(), ed_scan_result_t::p_in, PROTOCOL_ID, PROTOCOL_ID_LEN, and RESULT_SIZE_PER_CHANNEL.
Referenced by per_mode_initiator_ed_end_cb().
void usr_ed_scan_start_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint8_t | scan_time_min, | ||
float | scan_time_sec | ||
) |
Function to generate ED scan confirm test End Indication frame that must be sent to host application via serial interface.
Called by Performance application as Indication before starting the ED scan
status | Confirmation to the ED scan req |
scan_time_min | Approx time to be taken for ed can if timme is more than a minute |
scan_time_sec | Approx time to be taken for ed can if timme is less than a minute |
References ED_SCAN_START_CONFIRM, ED_SCAN_START_CONFIRM_LEN, EOT, get_next_tx_buffer(), PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by handle_incoming_msg(), and start_ed_scan().
void usr_get_current_config_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
trx_config_params_t * | curr_trx_conf_params | ||
) |
Function to generate Get Current config Confirm frame that must be sent to host application via serial interface.
Called by Performance application as confirmation after getting the all configurable paramters on source and peer node, if exists
status | Result for the set default config req |
curr_trx | config params structure of configurable paramters with current values |
References trx_config_params_t::ack_request, AT86RF230B, CH_PG_SUN, trx_config_params_t::channel, trx_config_params_t::channel_page, trx_config_params_t::csma_enabled, EOT, FIELD_DOES_NOT_EXIST, sun_phy_tag::freq_band, FSK, GET_CURRENT_CONFIG_CONFIRM, GET_CURRENT_CONFIG_CONFIRM_LEN, get_next_tx_buffer(), if(), LEG_OQPSK, sun_phy_tag::modulation, trx_config_params_t::number_test_frames, OFDM, OQPSK, sun_phy_tag::page_no, trx_config_params_t::phy_frame_length, PROTOCOL_ID, PROTOCOL_ID_LEN, trx_config_params_t::retry_enabled, trx_config_params_t::sun_phy_page, trx_config_params_t::trx_state, and trx_config_params_t::tx_power_dbm.
Referenced by get_current_configuration(), and handle_incoming_msg().
void usr_identify_board_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint8_t | ic_type, | ||
const char * | mcu_soc_name, | ||
const char * | trx_name, | ||
const char * | board_name, | ||
uint64_t | mac_address, | ||
float | fw_version, | ||
uint32_t | fw_feature_mask | ||
) |
Function to generate Identify Board confirm frame that must be sent to host application via serial interface.
Called by Performance application as confirmation to the board identify req
status | Result for the set default config req |
ic_type | Ic Type whether it is SOC or MCU |
mcu_soc_name | MCU or SOC name as string |
trx_name | Transceiver's name as string |
Board | Name HW Board name as string |
mac_address | MAC address of the source node |
fw_version | Firmware version |
fw_feature_mask | Features supported by the firmware |
References CCPU_ENDIAN_TO_LE32, EOT, fw_feature_mask, get_next_tx_buffer(), IDENTIFY_BOARD_CONFIRM, IDENTIFY_BOARD_CONFIRM_LEN, OCTET_STR_LEN_BYTE_LEN, PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by get_board_details().
void usr_identify_peer_node_confirm | ( | trx_id_t | trx, |
uint8_t | status | ||
) |
Function to generate Identify_peer_cnode_confirm that must be sent to host application via serial interface.
Called by Performance application as reply to the identify_peer_node_req
status | Result for identify_peer_node_req |
References EOT, get_next_tx_buffer(), IDENTIFY_PEER_NODE_CONFIRM, IDENTIFY_PEER_NODE_CONFIRM_LEN, PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by handle_incoming_msg(), identify_peer_node(), and per_mode_initiator_tx_done_cb().
void usr_peer_disconnect_confirm | ( | trx_id_t | trx, |
uint8_t | status | ||
) |
Function to generate Disconnect Confirm frame that must be sent to host application via serial interface.
Called by Performance application as confirmation after disconnecting from the peer node, if exists
status | Result for the Peer Disconnect Req |
References EOT, get_next_tx_buffer(), PEER_DISCONNECT_CONFIRM, PEER_DISCONNECT_CONFIRM_LEN, PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by disconnect_peer_node(), handle_incoming_msg(), and per_mode_initiator_tx_done_cb().
void usr_per_test_end_indication | ( | trx_id_t | trx, |
uint8_t | status, | ||
int8_t | rssi_val, | ||
uint8_t | aver_lqi, | ||
uint32_t | frames_transmitted, | ||
uint32_t | frames_received, | ||
uint32_t | frames_failure, | ||
uint32_t | frames_no_ack, | ||
uint32_t | frames_channel_access_failure, | ||
uint32_t | frames_with_wrong_crc, | ||
float | test_duration_sec, | ||
float | test_net_data_rate | ||
) |
Function to generate Per test End Indication frame that must be sent to host application via serial interface.
Called by Performance application as Indication afetr completion of PER test
status | Result for PER test intiated by per_test_start_req |
avg_rssi | Average RSSI meausred for PER Test |
avg_lqi | Average LQI meausred for PER Test |
frames_transmitted | No.of transmitted pkts in the PER Test |
frames_received | No.of received pkts in the PER Test |
frames_failure | No. Of pkts failed to transmit |
frames_no_ack | No. Of pkts transmitted without ACK |
frames_channel_access_failure | No. Channel access failures |
test_duration_sec | Time taken for the PER test |
test_net_data_rate | Net data rate for the test |
References EOT, get_next_tx_buffer(), PER_TEST_END_INDICATION, PER_TEST_END_INDICATION_LEN, PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by per_mode_initiator_rx_cb(), per_mode_initiator_tx_done_cb(), and wait_for_reply_timer_handler_cb().
void usr_per_test_start_confirm | ( | trx_id_t | trx, |
uint8_t | status | ||
) |
Function to generate Per Test Start confirmation frame that must be sent to host application via serial interface.
Called by Performance application as confirmation for per_test_start_req request
status | Result for requested per_test_start_req |
References EOT, get_next_tx_buffer(), PER_TEST_START_CONFIRM, PER_TEST_START_CONFIRM_LEN, PROTOCOL_ID, and PROTOCOL_ID_LEN.
Referenced by handle_incoming_msg(), initiate_per_test(), and start_test().
void usr_perf_get_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint8_t | parameter_type, | ||
param_value_t * | parame_value | ||
) |
Function to generate Perf Get confirmation frame that must be sent to host application via serial interface.
Called by Performance application as confirmation for perf_get_req request
status | Result for requested perf_get_req |
param_type | Type of the parameter that has been read |
parame_value | Pointer to the value of the parameter has been read |
References EOT, FSK, get_next_tx_buffer(), get_param_length(), LEG_OQPSK, MEMCPY_ENDIAN, OCTET_STR_LEN_BYTE_LEN, OFDM, OQPSK, PARAM_CHANNEL_PAGE, param_value_t::param_value_32bit, param_value_t::param_value_8bit, PERF_GET_CONFIRM, PERF_GET_CONFIRM_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and SUN_PAGE_NO.
Referenced by handle_incoming_msg(), per_mode_initiator_rx_cb(), perf_get_req(), and wait_for_reply_timer_handler_cb().
void usr_perf_set_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint8_t | param_type, | ||
param_value_t * | param_value | ||
) |
Function to generate Perf Set confirmation frame that must be sent to host application via serial interface.
Called by Performance application as confirmation for perf_set_req request
status | Result for requested perf_set_req |
param_type | Type of the parameter that has been set |
parame_value | Pointer to the value of the parameter that has been set |
References EOT, FSK, get_next_tx_buffer(), get_param_length(), LEG_OQPSK, MEMCPY_ENDIAN, OCTET_STR_LEN_BYTE_LEN, OFDM, OQPSK, PARAM_CHANNEL_PAGE, param_value_t::param_value_32bit, param_value_t::param_value_8bit, PERF_SET_CONFIRM, PERF_SET_CONFIRM_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and SUN_PAGE_NO.
Referenced by config_ack_request(), config_crc_peer_node(), config_csma(), config_frame_retry(), config_rx_desensitization(), handle_incoming_msg(), per_mode_initiator_tx_done_cb(), perf_set_req(), perf_set_sun_page(), set_channel_app(), set_channel_page(), set_parameter_on_transmitter_node(), set_phy_frame_length(), set_transceiver_state(), and set_tx_power().
void usr_perf_start_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint8_t | start_mode, | ||
trx_config_params_t * | trx_config_params, | ||
uint8_t | peer_ic_type, | ||
char * | peer_soc_mcu_name, | ||
char * | peer_trx_name, | ||
char * | peer_board_name, | ||
uint64_t | peer_mac_address, | ||
float | peer_fw_version, | ||
uint32_t | peer_feature_mask | ||
) |
Function to generate Perf Start confirmation frame that must be sent to host application via serial interface.
Called by Performance application as confirmation for perf_start_req
status | Result for requested Perf start request |
start | mode In which mode the transmitter is started i.e.single node or PER mode |
trx_config_params | configurable param values structure |
peer_ic_type | Peer Ic Type whether it is SOC or MCU |
peer_soc_mcu_name | Peer MCU or SOC name as string |
peer_trx_name | Peer Transceiver's name as string |
peer_board_name | Name Peer HW Board name as string |
peer_mac_address | MAC address of the Peer node |
References trx_config_params_t::ack_request, trx_config_params_t::channel, trx_config_params_t::channel_page, trx_config_params_t::csma_enabled, EOT, EXT_ADDR_LEN, FIELD_DOES_NOT_EXIST, get_next_tx_buffer(), trx_config_params_t::number_test_frames, PERF_START_CONFIRM, PERF_START_CONFIRM_LEN, trx_config_params_t::phy_frame_length, PROTOCOL_ID, PROTOCOL_ID_LEN, trx_config_params_t::retry_enabled, START_MODE_PER, trx_config_params_t::trx_state, and trx_config_params_t::tx_power_dbm.
Referenced by handle_incoming_msg(), peer_rsp_rcvd_init(), peer_rsp_rcvd_tx_cb(), per_mode_initiator_init(), per_mode_initiator_rx_cb(), and wait_for_reply_timer_handler_cb().
void usr_range_test_beacon_rsp | ( | trx_id_t | trx, |
frame_info_t * | frame, | ||
uint8_t | lqi_h, | ||
int8_t | ed_h, | ||
uint8_t | lqi_r, | ||
int8_t | ed_r | ||
) |
Function to send the Received Range Test Response frame to the Host application.
frame | Pointer to the actual frame Received |
lqi_h | LQI of the received response calculated at host |
ed_h | ED value of the received response calculated at host |
lqi_r | LQI of the sent range test packet calculated at receptor |
ed_r | ED value of the sent range test packet calculated at receptor |
References EOT, get_next_tx_buffer(), frame_info_tag::len_no_crc, LENGTH_FIELD_LEN, frame_info_tag::mpdu, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_BEACON_RESPONSE, RANGE_TEST_RSP_PKT_LEN, and tal_pib.
Referenced by per_mode_initiator_rx_cb().
void usr_range_test_beacon_tx | ( | trx_id_t | trx, |
frame_info_t * | frame | ||
) |
Function to send the transmitted frame to the Host application.
frame | Pointer to the actual frame transmitted |
References EOT, FRAME_OVERHEAD, get_next_tx_buffer(), frame_info_tag::len_no_crc, LENGTH_FIELD_LEN, frame_info_tag::mpdu, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_BEACON, RANGE_TEST_PAYLOAD_LENGTH, and tal_pib.
Referenced by per_mode_initiator_tx_done_cb().
void usr_range_test_marker_ind | ( | trx_id_t | trx, |
frame_info_t * | frame, | ||
uint8_t | lqi, | ||
int8_t | ed_value | ||
) |
Function to send the Marker Indication frame to the Host application.
mpdu | Pointer to the actual marker frame Received |
lqi | LQI of the received marker packet |
ed_value | ED value of the received marker packet |
frame | Pointer to the actual marker frame Received |
lqi | LQI of the received marker packet |
ed_value | ED value of the received marker packet |
References EOT, get_next_tx_buffer(), frame_info_tag::len_no_crc, LENGTH_FIELD_LEN, frame_info_tag::mpdu, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_MARKER_IND_LEN, RANGE_TEST_MARKER_INDICATION, and tal_pib.
Referenced by per_mode_initiator_rx_cb().
void usr_range_test_start_confirm | ( | trx_id_t | trx, |
uint8_t | status | ||
) |
Function to generate Range Test Start confirmation frame that must be sent to host application via serial interface.
Called by Performance application as confirmation for range_test_start_req request
status | Result for requested range_test_start_req |
References EOT, get_next_tx_buffer(), PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_START_CONFIRM, and RANGE_TEST_START_CONFIRM_LEN.
Referenced by handle_incoming_msg(), initiate_range_test(), per_mode_initiator_tx_done_cb(), start_range_test(), and stop_range_test().
void usr_range_test_stop_confirm | ( | trx_id_t | trx, |
uint8_t | status | ||
) |
Function to generate Range Test Stop confirmation frame that must be sent to host application via serial interface.
Called by Performance application as confirmation for range_test_start_req request
status | Result for requested range_test_stop_req |
References EOT, get_next_tx_buffer(), PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_START_CONFIRM_LEN, and RANGE_TEST_STOP_CONFIRM.
Referenced by per_mode_initiator_tx_done_cb().
void usr_register_dump_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint16_t | start_reg_addr, | ||
uint16_t | end_reg_addr, | ||
uint8_t * | reg_val | ||
) |
Function to generate usr_register_dump_confirm that must be sent to host application via serial interface.
Called by Performance application as reply to the usr_register_dump_req
status | Result for usr_register_dump_req |
start_reg_addr | Start Register address that has to be read |
end_reg_addr | End Register address that has to be read |
*reg_val | Arrray of Register values |
References BYTE_LEN, EOT, get_next_tx_buffer(), NUL_VAL, PROTOCOL_ID, PROTOCOL_ID_LEN, REGISTER_DUMP_CONFIRM, and REGISTER_DUMP_CONFIRM_LEN.
Referenced by dump_trx_register_values(), and handle_incoming_msg().
void usr_register_read_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint16_t | reg_addr, | ||
uint8_t | reg_val | ||
) |
Function to generate usr_register_read_confirm that must be sent to host application via serial interface.
Called by Performance application as reply to the usr_register_read_req
status | Result for usr_register_read_req |
reg_addr | Register address that has been read |
reg_val | Register value |
References BYTE_LEN, EOT, get_next_tx_buffer(), PROTOCOL_ID, PROTOCOL_ID_LEN, REGISTER_READ_CONFIRM, and REGISTER_READ_CONFIRM_LEN.
Referenced by handle_incoming_msg(), and read_trx_registers().
void usr_register_write_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
uint16_t | reg_addr, | ||
uint8_t | reg_val | ||
) |
Function to generate usr_register_write_confirm that must be sent to host application via serial interface.
Called by Performance application as reply to the usr_register_write_req
status | Result for usr_register_write_req |
reg_addr | Register address that has been set |
reg_val | Register value |
References BYTE_LEN, EOT, get_next_tx_buffer(), PROTOCOL_ID, PROTOCOL_ID_LEN, REGISTER_WRITE_CONFIRM, and REGISTER_WRITE_CONFIRM_LEN.
Referenced by handle_incoming_msg(), and write_trx_registers().
void usr_sensor_data_get_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
float | bat_voltage, | ||
float | temperature | ||
) |
Function to generate Sensor data confirm frame that must be sent to host application via serial interface.
Called by Performance application as confirmation after getting the sensor data
status | Result for the Sensor data get req |
bat_voltage | Battery voltage vlaue |
temperature | temperature value |
References EOT, get_next_tx_buffer(), PROTOCOL_ID, PROTOCOL_ID_LEN, SENSOR_DATA_CONFIRM, and SENSOR_DATA_CONFIRM_LEN.
Referenced by get_sensor_data(), and handle_incoming_msg().
void usr_set_default_config_confirm | ( | trx_id_t | trx, |
uint8_t | status, | ||
trx_config_params_t * | default_trx_config_params | ||
) |
Function to generate Set default config Confirm frame that must be sent to host application via serial interface.
Called by Performance application as confirmation after setting the all configurable paramters on source and peer node, if exists
status | Result for the set default config req |
default_trx | config params structure of configurable paramters with default values |
References trx_config_params_t::ack_request, trx_config_params_t::channel, trx_config_params_t::channel_page, trx_config_params_t::csma_enabled, EOT, FIELD_DOES_NOT_EXIST, get_next_tx_buffer(), trx_config_params_t::number_test_frames, trx_config_params_t::phy_frame_length, PROTOCOL_ID, PROTOCOL_ID_LEN, trx_config_params_t::retry_enabled, SET_DEFAULT_CONFIG_CONFIRM, SET_DEFAULT_CONFIG_CONFIRM_LEN, trx_config_params_t::trx_state, and trx_config_params_t::tx_power_dbm.
Referenced by handle_incoming_msg(), per_mode_initiator_tx_done_cb(), and set_default_configuration().
void write_trx_registers | ( | trx_id_t | trx, |
uint16_t | reg_addr, | ||
uint8_t | reg_val | ||
) |
write Transceiver registers
reg_addr | The address of the register to be read |
reg_val | The 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().
|
static |
This is buffer count to keep track of the available bufer for transmission.
Referenced by get_next_tx_buffer(), and serial_data_handler().
|
static |
Referenced by serial_data_handler().
|
static |
This is the buffer to hold the frame received through serial interface.
Referenced by configure_range_test_frame_sending(), process_incoming_sio_data(), range_test_frame_tx(), send_crc_status_req(), send_crc_status_rsp(), send_parameters_changed(), send_peer_conf(), send_peer_info_rsp(), send_peer_req(), send_peer_rsp(), send_per_test_start_cmd(), send_range_test_marker_cmd(), send_range_test_marker_rsp(), send_range_test_rsp(), send_range_test_start_cmd(), send_range_test_stop_cmd(), send_result_req(), send_result_rsp(), send_sun_page_changed(), serial_data_handler(), and tfa_continuous_tx_start().
|
static |
This is length variable to keep track of no of received bytes.
Referenced by serial_data_handler().
|
static |
This is head of the queue of buffers to be transmitted.
Referenced by get_next_tx_buffer(), and serial_data_handler().
uint16_t param_value_t::param_value_16bit |
Parameter 16-bit.
Referenced by perf_set_req().
uint32_t param_value_t::param_value_32bit |
Parameter 32-bit.
Referenced by perf_set_req(), usr_perf_get_confirm(), and usr_perf_set_confirm().
uint64_t param_value_t::param_value_64bit |
Parameter 64-bit.
uint8_t param_value_t::param_value_8bit |
Parameter 8-bit.
Referenced by handle_incoming_msg(), perf_set_req(), usr_perf_get_confirm(), and usr_perf_set_confirm().
bool param_value_t::param_value_bool |
Parameter Bool.
Referenced by perf_set_req().
float param_value_t::param_value_float |
Parameter float.
uint32_t rcvd_channel_mask[NUM_TRX] = {0, 0} |
Referenced by handle_incoming_msg().
|
static |
This is index used to validate the received bytes based on their position.
Referenced by process_incoming_sio_data(), and serial_data_handler().
|
static |
This is the receive buffer of the UART.
Referenced by handle_incoming_msg(), and process_incoming_sio_data().
|
static |
This is the transmit state of the UART.
(UART_TX_STATE_SOT, UART_TX_STATE_LENGTH, UART_TX_STATE_DATA, or UART_TX_STATE_EOT) This is the length of the message should be received.
Referenced by process_incoming_sio_data().
|
static |
This pointer points to the next free element inside the receive buffer of the UART.
Referenced by process_incoming_sio_data().
|
static |
This is the receiver state of the UART.
(UART_RX_STATE_SOT, UART_RX_STATE_LENGTH, UART_RX_STATE_DATA, or UART_RX_STATE_EOT)
Referenced by init_sio(), and process_incoming_sio_data().
|
static |
This is the transmit buffer of the UART.
Referenced by get_next_tx_buffer(), and serial_data_handler().