Microchip® Advanced Software Framework

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

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)
 
More...
 
void perf_set_sun_page (trx_id_t trx, uint8_t *sun_page)
 
More...
 
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

to the Request Primitives

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

Command Lengths

#define PROTOCOL_ID_LEN   (1)
 
#define OCTET_STR_LEN_BYTE_LEN   (1)
 
#define IDENTIFY_BOARD_CONFIRM_LEN   (19)
 
#define PERF_START_CONFIRM_LEN   (31)
 
#define PERF_SET_CONFIRM_LEN   (3)
 
#define PERF_GET_CONFIRM_LEN   (3)
 
#define IDENTIFY_PEER_NODE_CONFIRM_LEN   (2)
 
#define CONT_PULSE_TX_CONFIRM_LEN   (2)
 
#define CONT_WAVE_TX_CONFIRM_LEN   (4)
 
#define REGISTER_READ_CONFIRM_LEN   (5)
 
#define REGISTER_WRITE_CONFIRM_LEN   (5)
 
#define REGISTER_DUMP_CONFIRM_LEN   (6)
 
#define ED_SCAN_START_CONFIRM_LEN   (7)
 
#define ED_SCAN_END_INDICATION_LEN   (2)
 
#define SENSOR_DATA_CONFIRM_LEN   (10)
 
#define PER_TEST_START_CONFIRM_LEN   (2)
 
#define RANGE_TEST_START_CONFIRM_LEN   (2)
 
#define RANGE_TEST_RSP_PKT_LEN   (5) /*Excluding ota packet*/
 
#define RANGE_TEST_MARKER_IND_LEN   (3) /*Excluding ota packet*/
 
#define RANGE_TEST_STOP_CONFIRM_LEN   (2)
 
#define PER_TEST_END_INDICATION_LEN   (36)
 
#define PEER_DISCONNECT_CONFIRM_LEN   (2)
 
#define SET_DEFAULT_CONFIG_CONFIRM_LEN   (22)
 
#define GET_CURRENT_CONFIG_CONFIRM_LEN   (25)
 
#define RANGE_MEASURE_STATS_CONFIRM   (10)
 

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)
 

Request , Confirm and Indication Message Codes

enum  msg_code {
  IDENTIFY_BOARD_REQ = (0x00),
  PERF_START_REQ = (0x01),
  PERF_SET_REQ = (0x02),
  PERF_GET_REQ = (0x03),
  IDENTIFY_PEER_NODE_REQ = (0x04),
  CONT_PULSE_TX_REQ = (0x05),
  CONT_WAVE_TX_REQ = (0x06),
  REGISTER_READ_REQ = (0x07),
  REGISTER_WRITE_REQ = (0x08),
  REGISTER_DUMP_REQ = (0x09),
  ED_SCAN_START_REQ = (0x0a),
  SENSOR_DATA_REQ = (0x0b),
  PER_TEST_START_REQ = (0x0c),
  PEER_DISCONNECT_REQ = (0x0d),
  SET_DEFAULT_CONFIG_REQ = (0x0e),
  GET_CURRENT_CONFIG_REQ = (0x0f),
  RANGE_TEST_START_REQ = (0X50),
  RANGE_TEST_STOP_REQ = (0x52),
  IDENTIFY_BOARD_CONFIRM = (0x10),
  PERF_START_CONFIRM = (0x11),
  PERF_SET_CONFIRM = (0x12),
  PERF_GET_CONFIRM = (0x13),
  IDENTIFY_PEER_NODE_CONFIRM = (0x14),
  CONT_PULSE_TX_CONFIRM = (0x15),
  CONT_WAVE_TX_CONFIRM = (0x16),
  REGISTER_READ_CONFIRM = (0x17),
  REGISTER_WRITE_CONFIRM = (0x18),
  REGISTER_DUMP_CONFIRM = (0x19),
  ED_SCAN_START_CONFIRM = (0x1a),
  ED_SCAN_END_INDICATION = (0x1b),
  SENSOR_DATA_CONFIRM = (0x1c),
  PER_TEST_START_CONFIRM = (0x1d),
  PER_TEST_END_INDICATION = (0x1e),
  PEER_DISCONNECT_CONFIRM = (0x1f),
  SET_DEFAULT_CONFIG_CONFIRM = (0x20),
  GET_CURRENT_CONFIG_CONFIRM = (0x21),
  RANGE_TEST_START_CONFIRM = (0x51),
  RANGE_TEST_STOP_CONFIRM = (0x53),
  RANGE_TEST_BEACON_RESPONSE = (0x54),
  RANGE_TEST_BEACON = (0x55),
  RANGE_TEST_MARKER_INDICATION = (0x56),
  TAL_DATA_INDICATION = (0x00),
  MLME_ASSOCIATE_REQUEST = (0x01),
  MLME_ASSOCIATE_RESPONSE = (0x02),
  MCPS_DATA_REQUEST = (0x03),
  MCPS_PURGE_REQUEST = (0x04),
  MLME_DISASSOCIATE_REQUEST = (0x05),
  MLME_ORPHAN_RESPONSE = (0x07),
  MLME_GET_REQUEST = (0x08),
  MLME_RESET_REQUEST = (0x09),
  MLME_RX_ENABLE_REQUEST = (0x0A),
  MLME_SCAN_REQUEST = (0x0B),
  MLME_GTS_REQUEST = (0x0C),
  MLME_START_REQUEST = (0x0D),
  MLME_POLL_REQUEST = (0x0E),
  MLME_SYNC_REQUEST = (0x0F),
  MCPS_DATA_CONFIRM = (0x10),
  MCPS_DATA_INDICATION = (0x11),
  MCPS_PURGE_CONFIRM = (0x12),
  MLME_ASSOCIATE_INDICATION = (0x13),
  MLME_ASSOCIATE_CONFIRM = (0x14),
  MLME_DISASSOCIATE_INDICATION = (0x15),
  MLME_DISASSOCIATE_CONFIRM = (0x16),
  MLME_BEACON_NOTIFY_INDICATION = (0x17),
  MLME_GTS_CONFIRM = (0x18),
  MLME_GTS_INDICATION = (0x19),
  MLME_ORPHAN_INDICATION = (0x1A),
  MLME_SCAN_CONFIRM = (0x1B),
  MLME_COMM_STATUS_INDICATION = (0x1C),
  MLME_SYNC_LOSS_INDICATION = (0x1D),
  MLME_GET_CONFIRM = (0x1E),
  MLME_RESET_CONFIRM = (0x20),
  MLME_RX_ENABLE_CONFIRM = (0x21),
  MLME_START_CONFIRM = (0x22),
  MLME_POLL_CONFIRM = (0x23),
  MAC_INC_FRAME = (0x24)
}
 
enum msg_code SHORTENUM
 

#define CHANNELS_SELECT_POS   (4)

Referenced by handle_incoming_msg().

#define CONT_PULSE_TX_CONFIRM_LEN   (2)
#define CONT_WAVE_TX_CONFIRM_LEN   (4)
#define CW_TRANSMISSION_UNDER_PROGRESS   (0x23)
#define ED_SCAN_END_INDICATION_LEN   (2)
#define ED_SCAN_START_CONFIRM_LEN   (7)
#define ED_SCAN_UNDER_PROGRESS   (0x21)

Referenced by check_error_conditions().

#define END_REG_ADDR_POS   (5)

Referenced by handle_incoming_msg().

#define FIELD_DOES_NOT_EXIST   (0xFF)
#define GET_CURRENT_CONFIG_CONFIRM_LEN   (25)
#define IDENTIFY_BOARD_CONFIRM_LEN   (19)
#define IDENTIFY_PEER_NODE_CONFIRM_LEN   (2)
#define INVALID_ARGUMENT   (0x26)
#define INVALID_REGISTER_ORDER   (0x28)
#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)
#define OCTET_STR_LEN_BYTE_LEN   (1)
#define PARAM_ACK_REQUEST   (0x06)
#define PARAM_ANT_DIVERSITY   (0x07)
#define PARAM_ANT_DIVERSITY_ON_PEER   (0x08)
#define PARAM_CHANNEL   (0x00)
#define PARAM_CSMA   (0x04)
#define PARAM_DESENSITIZATION   (0x09)
#define PARAM_FRAME_RETRY   (0x05)
#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)
#define PARAM_RPC   (0x0e)

Referenced by perf_get_req(), and perf_set_req().

#define PARAM_TRX_STATE   (0x0a)
#define PARAM_TX_POWER_DBM   (0x03)
#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)
#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)
#define PER_TEST_START_CONFIRM_LEN   (2)
#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 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*/
#define RANGE_TEST_RSP_PKT_LEN   (5) /*Excluding ota packet*/
#define RANGE_TEST_START_CONFIRM_LEN   (2)
#define RANGE_TEST_STOP_CONFIRM_LEN   (2)
#define REGISTER_ADDR_POS   (3)

Referenced by handle_incoming_msg().

#define REGISTER_DUMP_CONFIRM_LEN   (6)
#define REGISTER_READ_CONFIRM_LEN   (5)
#define REGISTER_VAL_POS   (5)

Referenced by handle_incoming_msg().

#define REGISTER_WRITE_CONFIRM_LEN   (5)
#define RESULT_SIZE_PER_CHANNEL   (2)
#define SCAN_DURATION_POS   (3)

Referenced by handle_incoming_msg().

#define SENSOR_DATA_CONFIRM_LEN   (10)
#define SET_DEFAULT_CONFIG_CONFIRM_LEN   (22)
#define SIO_BUF_COUNT   (3)
#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)
#define START_MODE_POS   (3)

Referenced by handle_incoming_msg().

#define START_MODE_SINGLE_NODE   (2)
#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)
#define TRANSCEIVER_IN_SLEEP   (0x29)
#define TRANSMISSION_FAILURE   (0x30)
#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().

enum msg_code
Enumerator
IDENTIFY_BOARD_REQ 
PERF_START_REQ 
PERF_SET_REQ 
PERF_GET_REQ 
IDENTIFY_PEER_NODE_REQ 
CONT_PULSE_TX_REQ 
CONT_WAVE_TX_REQ 
REGISTER_READ_REQ 
REGISTER_WRITE_REQ 
REGISTER_DUMP_REQ 
ED_SCAN_START_REQ 
SENSOR_DATA_REQ 
PER_TEST_START_REQ 
PEER_DISCONNECT_REQ 
SET_DEFAULT_CONFIG_REQ 
GET_CURRENT_CONFIG_REQ 
RANGE_TEST_START_REQ 
RANGE_TEST_STOP_REQ 
IDENTIFY_BOARD_CONFIRM 
PERF_START_CONFIRM 
PERF_SET_CONFIRM 
PERF_GET_CONFIRM 
IDENTIFY_PEER_NODE_CONFIRM 
CONT_PULSE_TX_CONFIRM 
CONT_WAVE_TX_CONFIRM 
REGISTER_READ_CONFIRM 
REGISTER_WRITE_CONFIRM 
REGISTER_DUMP_CONFIRM 
ED_SCAN_START_CONFIRM 
ED_SCAN_END_INDICATION 
SENSOR_DATA_CONFIRM 
PER_TEST_START_CONFIRM 
PER_TEST_END_INDICATION 
PEER_DISCONNECT_CONFIRM 
SET_DEFAULT_CONFIG_CONFIRM 
GET_CURRENT_CONFIG_CONFIRM 
RANGE_TEST_START_CONFIRM 
RANGE_TEST_STOP_CONFIRM 
RANGE_TEST_BEACON_RESPONSE 
RANGE_TEST_BEACON 
RANGE_TEST_MARKER_INDICATION 
TAL_DATA_INDICATION 
MLME_ASSOCIATE_REQUEST 
MLME_ASSOCIATE_RESPONSE 
MCPS_DATA_REQUEST 
MCPS_PURGE_REQUEST 
MLME_DISASSOCIATE_REQUEST 
MLME_ORPHAN_RESPONSE 
MLME_GET_REQUEST 
MLME_RESET_REQUEST 
MLME_RX_ENABLE_REQUEST 
MLME_SCAN_REQUEST 
MLME_GTS_REQUEST 
MLME_START_REQUEST 
MLME_POLL_REQUEST 
MLME_SYNC_REQUEST 
MCPS_DATA_CONFIRM 
MCPS_DATA_INDICATION 
MCPS_PURGE_CONFIRM 
MLME_ASSOCIATE_INDICATION 
MLME_ASSOCIATE_CONFIRM 
MLME_DISASSOCIATE_INDICATION 
MLME_DISASSOCIATE_CONFIRM 
MLME_BEACON_NOTIFY_INDICATION 
MLME_GTS_CONFIRM 
MLME_GTS_INDICATION 
MLME_ORPHAN_INDICATION 
MLME_SCAN_CONFIRM 
MLME_COMM_STATUS_INDICATION 
MLME_SYNC_LOSS_INDICATION 
MLME_GET_CONFIRM 
MLME_RESET_CONFIRM 
MLME_RX_ENABLE_CONFIRM 
MLME_START_CONFIRM 
MLME_POLL_CONFIRM 
MAC_INC_FRAME 

uint8_t check_error_conditions ( trx_id_t  trx)

Function used to check the error conditions before.

processing the received command

Returns
the erroe codee based onthe currently ongoing operation,if any

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

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

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

uint8_t get_param_length ( uint8_t  parameter_type)
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().

static void handle_incoming_msg ( trx_id_t  trx)
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)
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)
void initiate_range_test ( trx_id_t  trx)
void perf_set_sun_page ( trx_id_t  trx,
uint8_t *  param_val 
)
static void process_incoming_sio_data ( trx_id_t  trx)
inlinestatic
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().

float reverse_float ( const float  float_val)

The reverse_float is used for reversing a float variable for supporting BIG ENDIAN systems.

Parameters
float_valFloat variable to be reversed

Referenced by get_board_details(), get_node_info(), get_sensor_data(), per_mode_initiator_rx_cb(), and start_ed_scan().

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

Parameters
scan_durationparamter which is used to calculate the scan time on each channel

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_range_test ( trx_id_t  trx)
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

Parameters
statusResult 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

Parameters
statusResult for cont_wave_tx_req
start_stop_paramParameter to start or stop cont tx
tx_modeIndicates 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

Parameters
no_of_channelsNo. of channels scanned
ed_scan_resultList of Energy values along with the channel numbers
Returns
void

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

Parameters
statusConfirmation to the ED scan req
scan_time_minApprox time to be taken for ed can if timme is more than a minute
scan_time_secApprox time to be taken for ed can if timme is less than a minute
Returns
void

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

Parameters
statusResult for the set default config req
curr_trxconfig params structure of configurable paramters with current values
Returns
void

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

Parameters
statusResult for the set default config req
ic_typeIc Type whether it is SOC or MCU
mcu_soc_nameMCU or SOC name as string
trx_nameTransceiver's name as string
BoardName HW Board name as string
mac_addressMAC address of the source node
fw_versionFirmware version
fw_feature_maskFeatures supported by the firmware
Returns
void

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

Parameters
statusResult 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

Parameters
statusResult for the Peer Disconnect Req
Returns
void

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

Parameters
statusResult for PER test intiated by per_test_start_req
avg_rssiAverage RSSI meausred for PER Test
avg_lqiAverage LQI meausred for PER Test
frames_transmittedNo.of transmitted pkts in the PER Test
frames_receivedNo.of received pkts in the PER Test
frames_failureNo. Of pkts failed to transmit
frames_no_ackNo. Of pkts transmitted without ACK
frames_channel_access_failureNo. Channel access failures
test_duration_secTime taken for the PER test
test_net_data_rateNet data rate for the test
Returns
void

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

Parameters
statusResult for requested per_test_start_req
Returns
void

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

Parameters
statusResult for requested perf_get_req
param_typeType of the parameter that has been read
parame_valuePointer to the value of the parameter has been read
Returns
void

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

Parameters
statusResult for requested perf_set_req
param_typeType of the parameter that has been set
parame_valuePointer to the value of the parameter that has been set
Returns
void

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

Parameters
statusResult for requested Perf start request
startmode In which mode the transmitter is started i.e.single node or PER mode
trx_config_paramsconfigurable param values structure
peer_ic_typePeer Ic Type whether it is SOC or MCU
peer_soc_mcu_namePeer MCU or SOC name as string
peer_trx_namePeer Transceiver's name as string
peer_board_nameName Peer HW Board name as string
peer_mac_addressMAC address of the Peer node
Returns
void

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.

Parameters
framePointer to the actual frame Received
lqi_hLQI of the received response calculated at host
ed_hED value of the received response calculated at host
lqi_rLQI of the sent range test packet calculated at receptor
ed_rED 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.

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

Parameters
mpduPointer to the actual marker frame Received
lqiLQI of the received marker packet
ed_valueED value of the received marker packet
framePointer to the actual marker frame Received
lqiLQI of the received marker packet
ed_valueED 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

Parameters
statusResult for requested range_test_start_req
Returns
void

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

Parameters
statusResult for requested range_test_stop_req
Returns
void

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

Parameters
statusResult for usr_register_dump_req
start_reg_addrStart Register address that has to be read
end_reg_addrEnd Register address that has to be read
*reg_valArrray 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

Parameters
statusResult for usr_register_read_req
reg_addrRegister address that has been read
reg_valRegister 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

Parameters
statusResult for usr_register_write_req
reg_addrRegister address that has been set
reg_valRegister 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

Parameters
statusResult for the Sensor data get req
bat_voltageBattery voltage vlaue
temperaturetemperature value
Returns
void

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

Parameters
statusResult for the set default config req
default_trxconfig params structure of configurable paramters with default values
Returns
void

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

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

uint8_t buf_count[NUM_TRX] = {0, 0}
static

This is buffer count to keep track of the available bufer for transmission.

Referenced by get_next_tx_buffer(), and serial_data_handler().

uint8_t curr_tx_buffer_index[NUM_TRX] = {0, 0}
static

Referenced by serial_data_handler().

uint8_t data_length[NUM_TRX] = {0, 0}
static

This is length variable to keep track of no of received bytes.

Referenced by serial_data_handler().

uint8_t head[NUM_TRX] = {0, 0}
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
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().

uint8_t rx_index[NUM_TRX] = {0, 0}
static

This is index used to validate the received bytes based on their position.

Referenced by process_incoming_sio_data(), and serial_data_handler().

uint8_t sio_rx_buf[NUM_TRX][SIO_RX_BUF_SIZE]
static

This is the receive buffer of the UART.

Referenced by handle_incoming_msg(), and process_incoming_sio_data().

uint8_t sio_rx_length[NUM_TRX]
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().

uint8_t* sio_rx_ptr[NUM_TRX]
static

This pointer points to the next free element inside the receive buffer of the UART.

Referenced by process_incoming_sio_data().

uint8_t sio_rx_state[NUM_TRX]
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().

uint8_t sio_tx_buf[NUM_TRX][SIO_BUF_COUNT][SIO_TX_BUF_SIZE]
static

This is the transmit buffer of the UART.

Referenced by get_next_tx_buffer(), and serial_data_handler().