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

bool cw_ack_sent
 
uint8_t cw_start_mode
 
uint16_t cw_tmr_val
 
uint8_t op_mode
 
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...
 
bool peer_found
 
uint32_t pkt_stream_gap_time
 
bool pkt_stream_stop
 
bool pulse_mode
 
bool rdy_to_tx
 
bool remote_cw_start
 
bool remote_pulse_cw_start
 
bool remote_serial_tx_failure
 
bool rx_on_mode
 
frame_info_tstream_pkt
 

UART COMMUNICATION FRAMING

static uint8_t sio_rx_buf [SIO_RX_BUF_SIZE]
 This is the receive buffer of the UART. More...
 
static uint8_t sio_tx_buf [SIO_BUF_COUNT][SIO_TX_BUF_SIZE]
 This is the transmit buffer of the UART. More...
 
static uint8_t * sio_rx_ptr
 This pointer points to the next free element inside the receive buffer of the UART. More...
 
static uint8_t sio_rx_state
 This is the receiver state of the UART. More...
 
static uint8_t sio_rx_length
 This is the transmit state of the UART. More...
 
static uint8_t data [SIO_RX_BUF_SIZE]
 This is the buffer to hold the frame received through serial interface. More...
 
static uint8_t data_length = 0
 This is length variable to keep track of no of received bytes. More...
 
static uint8_t rx_index = 0
 This is index used to validate the received bytes based on their position. More...
 
static uint8_t head = 0
 This is head of the queue of buffers to be transmitted. More...
 
static uint8_t buf_count = 0
 This is buffer count to keep track of the available bufer for transmission. More...
 
bool remote_cmd_rcvd = false
 This flag is used to check if a remote_test command has been received or not. More...
 
static uint8_t curr_tx_buffer_index = 0
 
static void process_incoming_sio_data (void)
 Process data received from SIO. More...
 
static uint8_t * get_next_tx_buffer (void)
 get the new buffer for next transmission through serial More...
 
static void handle_incoming_msg (void)
 Parses the Received Data in the Buffer and Process the Commands accordingly. More...
 
void init_sio (void)
 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 convert_ota_serial_frame_rx (uint8_t *buf, uint8_t len)
 
More...
 
void usr_perf_start_confirm (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 (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 (uint8_t *frame)
 Function to send the transmitted frame to the Host application. More...
 
void usr_range_test_beacon_rsp (uint8_t *mpdu, 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 (uint8_t *mpdu, 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 (uint8_t status)
 Function to generate Range Test Start confirmation frame that must be sent to host application via serial interface. More...
 
void convert_ota_serial_frame_tx (uint8_t *buf, uint8_t len)
 The Received Remote Reply Command is converted into Serial Data and sent to the Host interface. More...
 
void usr_range_test_stop_confirm (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 (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 (uint8_t status, uint8_t param_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 (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 (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 (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 (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 (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 (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 (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 (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_pkt_stream_confirm (uint8_t status, bool start_stop)
 
void usr_rx_on_confirm (uint8_t status, bool start_stop)
 
void usr_ed_scan_end_indication (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 (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 (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 (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 (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 (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 (uint8_t set_param_type, param_value_t *param_value)
 
More...
 
void perf_get_req (uint8_t param_type_data)
 Function to get the various configuaration paramters for PER Test. More...
 
void initiate_per_test (void)
 Initiates the test procedure. More...
 
void initiate_range_test (void)
 Initiates the Range test procedure. More...
 
void start_ed_scan (uint8_t scan_duration, uint32_t channel_sel_mask)
 Function to start the ED scan. More...
 
void get_sensor_data (void)
 Function to get the Sensor data like Battery volatge. More...
 
void get_board_details (void)
 prints the hardware details More...
 
void stop_range_test (void)
 Function to Stop the range Test in PER Mode. More...
 
void identify_peer_node (void)
 Identifying peer node. More...
 
void send_remote_cmd (uint8_t *serial_buf, uint8_t len, bool ack_req)
 Function to send the command to Remote node to perform remote test. More...
 
void read_trx_registers (uint16_t reg_addr)
 Read transceiver register. More...
 
void write_trx_registers (uint16_t reg_addr, uint8_t reg_val)
 write Transceiver registers More...
 
void dump_trx_register_values (uint16_t start_reg_addr, uint16_t end_reg_addr)
 Read a set of registers. More...
 
void disconnect_peer_node (void)
 Function to request the peer to get disconnected from source node. More...
 
void set_default_configuration (void)
 Function to set the default values of. More...
 
void config_per_test_parameters (void)
 Function to set trx configure parameters. More...
 
void get_current_configuration (void)
 Function to get the current values of the all configurable parameters. More...
 
uint8_t check_error_conditions (void)
 Function used to check the error conditions before. More...
 
uint8_t get_param_length (uint8_t parameter_type)
 
void pktstream_test (uint16_t gap_time, uint16_t timeout, bool start_stop, uint16_t frame_len)
 Starts Packet streaming test. More...
 
void led_blinker_timer_handler_cb (void *parameter)
 Timer Callback function if identify command is received on air by a node in reflector configuration. More...
 
void rx_on_test (bool start_stop_param)
 This function is called to initiate the RX_ON test The transceiver is put into the RX_ON mode and no requests are handled until this mode is stopped. More...
 

Command Lengths

#define PROTOCOL_ID_LEN   (1)
 
#define OCTET_STR_LEN_BYTE_LEN   (1)
 
#define CMD_ID_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 PKT_STREAM_CONFIRM_LEN   (3)
 
#define RX_ON_CONFIRM_LEN   (3)
 
#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_PKT_LEN
 
#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   (26)
 
#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)
 
#define PKT_STREAM_IN_PROGRESS   (0x32)
 
#define RX_ON_MODE_IN_PROGRESS   (0x33)
 

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)
 
#define PER_REMOTE_CONFIG_MODE   ((uint32_t)(1) << 2)
 
#define PKT_STREAMING_MODE   ((uint32_t)(1) << 3)
 
#define CONTINUOUS_RX_ON_MODE   ((uint32_t)(1) << 4)
 
#define TX_OP_MODE   (0x01)
 
#define TEST_FRAMES_SENT   (0x02)
 
#define WAIT_FOR_TEST_RES   (0x03)
 
#define SET_PARAMETER   (0x04)
 
#define CONTINUOUS_TX_MODE   (0x07)
 
#define IDENTIFY_PEER   (0x08)
 
#define PEER_INFO_RSP_WAIT   (0x0B)
 
#define DISCONNECT_PEER   (0x0C)
 
#define SET_DEFAULT_CONFIG_PEER   (0x0D)
 
#define PER_TEST_START   (0x0E)
 
#define RANGE_TEST_START   (0x0F)
 
#define RANGE_TEST_TX   (0x10)
 
#define RANGE_TEST_STOP   (0x11)
 
#define REMOTE_TEST_MODE   (0X12)
 
#define PKT_STREAM_MODE   (0X13)
 
#define RANGE_TST_PKT_SEQ_POS   (11)
 
#define MAX_REG_ADDRESS   (0x1ff)
 
#define MIN_REG_ADDRESS   (0x141)
 
#define RX_DESENSITIZE_LEVEL   (0x08)
 
#define NO_RX_DESENSITIZE_LEVEL   (0x00)
 
#define INVALID_VALUE   (0xff)
 
#define FREQUENCY_MULTIPLIER   (2)
 
#define TRX_RESET   (0)
 
#define BIT_COUNT   (32)
 
#define MAX_SCAN_DURATION   (14)
 
#define NO_OF_REGISTERS   (65)
 
#define TIMEOUT_FOR_RESPONSE_IN_MICRO_SEC   (200000)
 
#define RANGE_TX_BEACON_INTERVAL   (3000000)
 
#define RANGE_TX_BEACON_START_INTERVAL   (100000)
 
#define MICRO_SEC_MULTIPLIER   (1.0 / 1000000)
 
#define MILLI_VOLT_MULTIPLIER   (1.0 / 1000)
 

Generic

#define REMOTE_CMD_MASK   (0x80)
 
#define MESSAGE_ID_MASK   (0x7F)
 
#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 CMD_POS   (3)
 
#define PARAM_TYPE_POS   (3)
 
#define PARAM_VALUE_POS   (5)
 
#define START_MODE_POS   (3)
 
#define START_STOP_POS   (3)
 
#define TX_MODE_POS   (4)
 
#define TMR_VAL_1   (5)
 
#define TMR_VAL_2   (6)
 
#define REGISTER_ADDR_POS   (3)
 
#define REGISTER_VAL_POS   (5)
 
#define PKTSTREAM_STOP   (0)
 
#define RX_ON_STOP   (0)
 
#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 FRAME_LEN_1   (4)
 
#define FRAME_LEN_2   (5)
 
#define GAP_TIME_1   (6)
 
#define GAP_TIME_2   (7)
 
#define TIMEOUT_VAL_1   (8)
 
#define TIMEOUT_VAL_2   (9)
 

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),
  PKT_STREAM_REQ = (0X22),
  RX_ON_REQ = (0X24),
  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),
  PKT_STREAM_CONFIRM = (0x23),
  RX_ON_CONFIRM = (0X25),
  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_SET_REQUEST = (0x06),
  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_SET_CONFIRM = (0x1F),
  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 BIT_COUNT   (32)

Referenced by set_channel().

#define CHANNELS_SELECT_POS   (4)

Referenced by handle_incoming_msg().

#define CMD_POS   (3)

Referenced by serial_data_handler().

#define CONT_PULSE_TX_CONFIRM_LEN   (2)
#define CONT_WAVE_TX_CONFIRM_LEN   (4)
#define CONTINUOUS_RX_ON_MODE   ((uint32_t)(1) << 4)

Referenced by get_board_details(), and get_node_info().

#define CONTINUOUS_TX_MODE   (0x07)
#define CW_TRANSMISSION_UNDER_PROGRESS   (0x23)
#define DISCONNECT_PEER   (0x0C)
#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 FRAME_LEN_1   (4)

Referenced by handle_incoming_msg().

#define FRAME_LEN_2   (5)

Referenced by handle_incoming_msg().

#define FREQUENCY_MULTIPLIER   (2)
#define GAP_TIME_1   (6)

Referenced by handle_incoming_msg().

#define GAP_TIME_2   (7)

Referenced by handle_incoming_msg().

#define GET_CURRENT_CONFIG_CONFIRM_LEN   (26)
#define IDENTIFY_BOARD_CONFIRM_LEN   (19)
#define IDENTIFY_PEER   (0x08)
#define IDENTIFY_PEER_NODE_CONFIRM_LEN   (2)
#define INVALID_ARGUMENT   (0x26)
#define INVALID_CMD   (0x20)
#define INVALID_REGISTER_ORDER   (0x28)
#define MAX_REG_ADDRESS   (0x1ff)
#define MAX_SCAN_DURATION   (14)

Referenced by start_ed_scan().

#define MESSAGE_ID_MASK   (0x7F)

Referenced by handle_incoming_msg().

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

Referenced by get_sensor_data().

#define MIN_REG_ADDRESS   (0x141)
#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_OF_REGISTERS   (65)
#define NO_PEER_FOUND   (0x24)
#define NO_RX_DESENSITIZE_LEVEL   (0x00)
#define OCTET_STR_LEN_BYTE_LEN   (1)
#define PARAM_ACK_REQUEST   (0x06)
#define PARAM_ANT_DIVERSITY   (0x07)

Referenced by perf_get_req(), and perf_set_req().

#define PARAM_CHANNEL   (0x00)
#define PARAM_CHANNEL_PAGE   (0x01)
#define PARAM_CSMA   (0x04)
#define PARAM_DESENSITIZATION   (0x09)

Referenced by perf_get_req(), and perf_set_req().

#define PARAM_FRAME_RETRY   (0x05)
#define PARAM_ISM_FREQUENCY   (0x0f)
#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)
#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 PEER_INFO_RSP_WAIT   (0x0B)
#define PER_RANGE_TEST_MODE   ((uint32_t)(1) << 1)

Referenced by get_board_details(), and get_node_info().

#define PER_REMOTE_CONFIG_MODE   ((uint32_t)(1) << 2)

Referenced by get_board_details(), and get_node_info().

#define PER_TEST_END_INDICATION_LEN   (36)
#define PER_TEST_START   (0x0E)
#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 PKT_STREAM_CONFIRM_LEN   (3)

Referenced by usr_pkt_stream_confirm().

#define PKT_STREAM_IN_PROGRESS   (0x32)
#define PKT_STREAM_MODE   (0X13)
#define PKT_STREAMING_MODE   ((uint32_t)(1) << 3)

Referenced by get_board_details(), and get_node_info().

#define PKTSTREAM_STOP   (0)

Referenced by handle_incoming_msg().

#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_PKT_LEN
Value:
#define FCS_LEN
Length (in octets) of FCS.
Definition: ieee_const.h:1297
#define RANGE_TEST_PKT_LENGTH
Definition: app_per_mode.h:155
#define LENGTH_FIELD_LEN
Size of the length parameter.
Definition: ieee_const.h:1277

Referenced by usr_range_test_beacon_tx().

#define RANGE_TEST_RSP_PKT_LEN   (5) /*Excluding ota packet*/
#define RANGE_TEST_START   (0x0F)
#define RANGE_TEST_START_CONFIRM_LEN   (2)
#define RANGE_TEST_STOP   (0x11)
#define RANGE_TEST_STOP_CONFIRM_LEN   (2)
#define RANGE_TST_PKT_SEQ_POS   (11)
#define RANGE_TX_BEACON_INTERVAL   (3000000)
#define RANGE_TX_BEACON_START_INTERVAL   (100000)

Referenced by start_range_test().

#define 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 REMOTE_CMD_MASK   (0x80)
#define REMOTE_TEST_MODE   (0X12)
#define RESULT_SIZE_PER_CHANNEL   (2)
#define RX_DESENSITIZE_LEVEL   (0x08)
#define RX_ON_CONFIRM_LEN   (3)

Referenced by usr_rx_on_confirm().

#define RX_ON_MODE_IN_PROGRESS   (0x33)
#define RX_ON_STOP   (0)

Referenced by handle_incoming_msg().

#define SCAN_DURATION_POS   (3)

Referenced by handle_incoming_msg().

#define SENSOR_DATA_CONFIRM_LEN   (10)
#define SET_DEFAULT_CONFIG_CONFIRM_LEN   (22)
#define SET_DEFAULT_CONFIG_PEER   (0x0D)
#define SET_PARAMETER   (0x04)
#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)

Referenced by handle_incoming_msg().

#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)

Referenced by handle_incoming_msg().

#define TEST_FRAMES_SENT   (0x02)
#define TIMEOUT_FOR_RESPONSE_IN_MICRO_SEC   (200000)
#define TIMEOUT_VAL_1   (8)

Referenced by handle_incoming_msg().

#define TIMEOUT_VAL_2   (9)

Referenced by handle_incoming_msg().

#define TMR_VAL_1   (5)

Referenced by handle_incoming_msg().

#define TMR_VAL_2   (6)

Referenced by handle_incoming_msg().

#define TRANSCEIVER_IN_SLEEP   (0x29)
#define TRANSMISSION_FAILURE   (0x30)
#define TRANSMISSION_UNDER_PROGRESS   (0x22)

Referenced by check_error_conditions().

#define TRX_RESET   (0)

Referenced by set_transceiver_state().

#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(), process_incoming_sio_data(), and serial_interface_init().

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 
PKT_STREAM_REQ 
RX_ON_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 
PKT_STREAM_CONFIRM 
RX_ON_CONFIRM 
TAL_DATA_INDICATION 
MLME_ASSOCIATE_REQUEST 
MLME_ASSOCIATE_RESPONSE 
MCPS_DATA_REQUEST 
MCPS_PURGE_REQUEST 
MLME_DISASSOCIATE_REQUEST 
MLME_SET_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_SET_CONFIRM 
MLME_RESET_CONFIRM 
MLME_RX_ENABLE_CONFIRM 
MLME_START_CONFIRM 
MLME_POLL_CONFIRM 
MAC_INC_FRAME 

uint8_t check_error_conditions ( void  )

Function used to check the error conditions before.

processing the received command

Returns
the error code based on the 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, PKT_STREAM_IN_PROGRESS, pkt_stream_stop, RANGE_TEST_IN_PROGRESS, range_test_in_progress, remote_serial_tx_failure, rx_on_mode, RX_ON_MODE_IN_PROGRESS, scanning, TRANSCEIVER_IN_SLEEP, TRANSMISSION_UNDER_PROGRESS, trx_sleep_status, and UNABLE_TO_CONTACT_PEER.

Referenced by handle_incoming_msg().

void convert_ota_serial_frame_rx ( uint8_t *  buf,
uint8_t  len 
)

The received over the air payload containing the serial data request for the remote node is converter into serial data to be used by the Serial Handler for processing further requests

Parameters
bufpointer to the payload len Length of the Serial Data Payload

References handle_incoming_msg(), and sio_rx_buf.

Referenced by per_mode_initiator_tx_done_cb(), per_mode_receptor_task(), and wait_for_reply_timer_handler_cb().

void convert_ota_serial_frame_tx ( uint8_t *  buf,
uint8_t  len 
)

The Received Remote Reply Command is converted into Serial Data and sent to the Host interface.

References EOT, get_next_tx_buffer(), and NULL.

Referenced by per_mode_initiator_rx_cb().

void disconnect_peer_node ( void  )
void dump_trx_register_values ( 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, status, tal_dump_registers(), usr_register_dump_confirm(), and VALUE_OUT_OF_RANGE.

Referenced by handle_incoming_msg().

void get_current_configuration ( void  )

Function to get the current values of the all configurable parameters.

in the Performance Analyzer application

Function to get the current values of the all configurable parameters.

References curr_trx_config_params, 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 ( void  )

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 ( void  )
inlinestatic

Parses the Received Data in the Buffer and Process the Commands accordingly.

References AT86RF233, 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, FRAME_LEN_1, FRAME_LEN_2, GAP_TIME_1, GAP_TIME_2, get_board_details(), GET_CURRENT_CONFIG_REQ, get_current_configuration(), get_param_length(), 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, node_ib_t::main_state, MEMCPY_ENDIAN, MESSAGE_ID_MASK, MESSAGE_ID_POS, MSG_LEN_ED_SCAN_POS, MSG_LEN_ED_SCAN_REQ, node_info, NUL_VAL, NULL, PARAM_TRX_STATE, PARAM_TYPE_POS, param_value_t::param_value_8bit, PARAM_VALUE_POS, PEER_DISCONNECT_REQ, 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_START_REQ, PKT_STREAM_IN_PROGRESS, PKT_STREAM_REQ, PKTSTREAM_STOP, pktstream_test(), PROTOCOL_ID, RANGE_TEST_START_REQ, RANGE_TEST_STOP_REQ, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, read_trx_registers(), REGISTER_ADDR_POS, REGISTER_DUMP_REQ, REGISTER_READ_REQ, REGISTER_VAL_POS, REGISTER_WRITE_REQ, REMOTE_CMD_MASK, remote_cmd_rcvd, RX_ON_MODE_IN_PROGRESS, RX_ON_REQ, RX_ON_STOP, rx_on_test(), SCAN_DURATION_POS, send_remote_cmd(), SENSOR_DATA_REQ, SET_DEFAULT_CONFIG_REQ, set_default_configuration(), set_main_state(), SINGLE_NODE_TESTS, sio_rx_buf, START_CWT, start_ed_scan(), START_MODE_PER, START_MODE_POS, START_MODE_SINGLE_NODE, START_REG_ADDR_POS, START_STOP_POS, STOP_CWT, stop_range_test(), TIMEOUT_VAL_1, TIMEOUT_VAL_2, TMR_VAL_1, TMR_VAL_2, TRANSCEIVER_IN_SLEEP, TRX_DEEP_SLEEP, TRX_SLEEP, TRX_SUPPORTED_CHANNELS, 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_pkt_stream_confirm(), usr_range_test_start_confirm(), usr_register_dump_confirm(), usr_register_read_confirm(), usr_register_write_confirm(), usr_rx_on_confirm(), usr_sensor_data_get_confirm(), usr_set_default_config_confirm(), WAIT_FOR_EVENT, and write_trx_registers().

Referenced by convert_ota_serial_frame_rx(), and process_incoming_sio_data().

void identify_peer_node ( void  )
void init_sio ( void  )

This function does the initialization of the Serial handler state Machine.

References sio_rx_state, and UART_RX_STATE_SOT.

Referenced by init_state_init().

void initiate_per_test ( void  )

Initiates the test procedure.

References op_mode, PER_TEST_START, send_per_test_start_cmd(), and TX_OP_MODE.

Referenced by handle_incoming_msg().

void initiate_range_test ( void  )
void led_blinker_timer_handler_cb ( void *  parameter)

Timer Callback function if identify command is received on air by a node in reflector configuration.

This is used to blink the LED and thus identify itself

Parameters
parameterpass parameters to timer handler

References app_led_event(), APP_TIMER_TO_TX, FUNC_PTR, LED_BLINK_COUNT_FOR_IDENTIFY, LED_BLINK_RATE_IN_MICRO_SEC, led_blinker_timer_handler_cb(), LED_EVENT_ALL_OFF, LED_EVENT_ALL_ON, LED_EVENT_PEER_SEARCH_DONE, NULL, SW_TIMEOUT_RELATIVE, sw_timer_start(), and sw_timer_stop().

Referenced by led_blinker_timer_handler_cb(), per_mode_receptor_rx_cb(), serial_data_handler(), and stop_pkt_streaming().

void pktstream_test ( uint16_t  gap_time,
uint16_t  timeout,
bool  start_stop,
uint16_t  frame_len 
)

Starts Packet streaming test.

Parameters
gap_timeTime between successive packets
timeoutTime to which packet streaming take place
start_stopParameter to start or stop packet streaming
frame_lenLength of the frame in bytes

Starts Packet streaming test.

Parameters
gap_timeGap to be provided between consecutive frames in terms of milliseconds : This parameter is used by the receptor node to timeout/stop the packet streaming
frame_lenLength of the Data frame to be streamed

References configure_pkt_stream_frames(), CW_TX_TIMER, FUNC_PTR, INVALID_ARGUMENT, MAC_SUCCESS, node_ib_t::main_state, node_info, NULL, op_mode, PER_TEST_RECEPTOR, pkt_stream_gap_time, pkt_stream_gap_timer(), PKT_STREAM_MODE, pkt_stream_stop, rdy_to_tx, serial_data_handler(), stop_pkt_streaming(), SW_TIMEOUT_RELATIVE, sw_timer_start(), sw_timer_stop(), T_APP_TIMER, TX_OP_MODE, and usr_pkt_stream_confirm().

Referenced by handle_incoming_msg().

static void process_incoming_sio_data ( void  )
inlinestatic
void read_trx_registers ( uint16_t  reg_addr)

Read transceiver register.

Parameters
reg_addrThe address of the register to be read

Read transceiver register.

Parameters
callback_parameterPointer to callback, not used here

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

void rx_on_test ( bool  start_stop_param)

This function is called to initiate the RX_ON test The transceiver is put into the RX_ON mode and no requests are handled until this mode is stopped.

On the receptor ,the mode is stopped only on reception of the RX_ON_STOP command which is sent without ack_req

Parameters
start_stop_paramIndicates whether the request is to Start or Stop the mode

References CMD_RX_AACK_ON, CMD_RX_ON, MAC_SUCCESS, node_ib_t::main_state, node_info, PER_TEST_RECEPTOR, RX_AACK_ON, RX_ON, rx_on_mode, set_trx_state(), trx_config_params_t::trx_state, and usr_rx_on_confirm().

Referenced by handle_incoming_msg().

void send_remote_cmd ( uint8_t *  serial_buf,
uint8_t  len,
bool  ack_req 
)
void serial_data_handler ( void  )

Function to handle the state machine serial data exchange.

Referenced by main(), performance_analyzer_task(), and pktstream_test().

void set_default_configuration ( void  )

Function to set the default values of.

all configurable parameters on source and peer node

Function to set the default values of.

References config_per_test_parameters(), default_trx_config_params, 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 ( uint8_t  ed_scan_duration,
uint32_t  channel_sel_mask 
)

Function to start the ED scan.

Parameters
scan_durationparameter which is used to calculate the scan time on each channel
channel_sel_maskSelected channel mask for which the Energy should be detected

Function to start the ED scan.

Parameters
ed_scan_durationScan duration parameter which is used to calculate the scan time on each channel
channel_sel_maskSelected channel mask for which the Energy should be detected

References aBaseSuperframeDuration, channel_before_scan, MAC_SUCCESS, MAX_CHANNEL, MAX_SCAN_DURATION, MIN_CHANNEL, NUL_VAL, num_channels, phy_tx_power, phyCurrentChannel, phyTransmitPower, reverse_float(), scan_channel_mask, scan_duration, scanning, TAL_CONVERT_SYMBOLS_TO_US, tal_pib, 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 ( void  )
void usr_cont_pulse_tx_confirm ( 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(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by handle_incoming_msg().

void usr_cont_wave_tx_confirm ( 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(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by handle_incoming_msg().

void usr_ed_scan_end_indication ( 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(), NULL, 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 ( 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 scan if time is more than a minute
scan_time_secApprox time to be taken for ed scan if time is less than a minute
Returns
void

References ED_SCAN_START_CONFIRM, ED_SCAN_START_CONFIRM_LEN, EOT, get_next_tx_buffer(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by handle_incoming_msg(), and start_ed_scan().

void usr_get_current_config_confirm ( 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 parameters on source and peer node, if exists

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

References trx_config_params_t::ack_request, AT86RF230B, AT86RF233, ATMEGARFR2, trx_config_params_t::channel, trx_config_params_t::channel_page, trx_config_params_t::csma_enabled, EOT, FIELD_DOES_NOT_EXIST, GET_CURRENT_CONFIG_CONFIRM, GET_CURRENT_CONFIG_CONFIRM_LEN, get_next_tx_buffer(), if(), trx_config_params_t::ism_frequency, NULL, 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, trx_config_params_t::rpc_enable, status, 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 ( 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
Returns
void

References CCPU_ENDIAN_TO_LE32, EOT, fw_feature_mask, fw_version, get_next_tx_buffer(), IDENTIFY_BOARD_CONFIRM, IDENTIFY_BOARD_CONFIRM_LEN, NULL, OCTET_STR_LEN_BYTE_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by get_board_details().

void usr_identify_peer_node_confirm ( 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, NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by handle_incoming_msg(), identify_peer_node(), and per_mode_initiator_tx_done_cb().

void usr_peer_disconnect_confirm ( 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(), NULL, PEER_DISCONNECT_CONFIRM, PEER_DISCONNECT_CONFIRM_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by disconnect_peer_node(), handle_incoming_msg(), and per_mode_initiator_tx_done_cb().

void usr_per_test_end_indication ( 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(), NULL, PER_TEST_END_INDICATION, PER_TEST_END_INDICATION_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

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 ( 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(), NULL, PER_TEST_START_CONFIRM, PER_TEST_START_CONFIRM_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by handle_incoming_msg(), and start_test().

void usr_perf_get_confirm ( uint8_t  status,
uint8_t  param_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, get_next_tx_buffer(), get_param_length(), MEMCPY_ENDIAN, NULL, OCTET_STR_LEN_BYTE_LEN, PERF_GET_CONFIRM, PERF_GET_CONFIRM_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

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 ( 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, get_next_tx_buffer(), get_param_length(), MEMCPY_ENDIAN, NULL, OCTET_STR_LEN_BYTE_LEN, PERF_SET_CONFIRM, PERF_SET_CONFIRM_LEN, PROTOCOL_ID, PROTOCOL_ID_LEN, and status.

Referenced by config_ack_request(), config_csma(), config_frame_retry(), config_frequency(), config_rpc_mode(), handle_incoming_msg(), per_mode_initiator_tx_done_cb(), perf_set_req(), set_channel(), set_channel_page(), set_parameter_on_transmitter_node(), set_phy_frame_length(), set_transceiver_state(), and set_tx_power().

void usr_perf_start_confirm ( 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, AT86RF230B, AT86RF233, ATMEGARFR2, 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(), if(), NULL, 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, trx_config_params_t::rpc_enable, START_MODE_PER, status, 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_pkt_stream_confirm ( uint8_t  status,
bool  start_stop 
)
void usr_range_test_beacon_rsp ( uint8_t *  mpdu,
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, FCS_LEN, get_next_tx_buffer(), i, LENGTH_FIELD_LEN, NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_BEACON_RESPONSE, and RANGE_TEST_RSP_PKT_LEN.

Referenced by per_mode_initiator_rx_cb().

void usr_range_test_beacon_tx ( uint8_t *  frame)

Function to send the transmitted frame to the Host application.

Parameters
framePointer to the actual frame transmitted

References EOT, get_next_tx_buffer(), i, NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_BEACON, and RANGE_TEST_PKT_LEN.

Referenced by per_mode_initiator_tx_done_cb().

void usr_range_test_marker_ind ( uint8_t *  mpdu,
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

References EOT, FCS_LEN, get_next_tx_buffer(), i, LENGTH_FIELD_LEN, NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_MARKER_IND_LEN, and RANGE_TEST_MARKER_INDICATION.

Referenced by per_mode_initiator_rx_cb().

void usr_range_test_start_confirm ( 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(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_START_CONFIRM, RANGE_TEST_START_CONFIRM_LEN, and status.

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 ( 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(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, RANGE_TEST_START_CONFIRM_LEN, RANGE_TEST_STOP_CONFIRM, and status.

Referenced by per_mode_initiator_tx_done_cb().

void usr_register_dump_confirm ( 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, NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, REGISTER_DUMP_CONFIRM, REGISTER_DUMP_CONFIRM_LEN, and status.

Referenced by dump_trx_register_values(), and handle_incoming_msg().

void usr_register_read_confirm ( 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(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, REGISTER_READ_CONFIRM, REGISTER_READ_CONFIRM_LEN, and status.

Referenced by handle_incoming_msg(), and read_trx_registers().

void usr_register_write_confirm ( 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(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, REGISTER_WRITE_CONFIRM, REGISTER_WRITE_CONFIRM_LEN, and status.

Referenced by handle_incoming_msg(), and write_trx_registers().

void usr_rx_on_confirm ( uint8_t  status,
bool  start_stop 
)
void usr_sensor_data_get_confirm ( 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 value
temperaturetemperature value
Returns
void

References EOT, get_next_tx_buffer(), NULL, PROTOCOL_ID, PROTOCOL_ID_LEN, SENSOR_DATA_CONFIRM, SENSOR_DATA_CONFIRM_LEN, and status.

Referenced by get_sensor_data(), and handle_incoming_msg().

void usr_set_default_config_confirm ( 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, AT86RF230B, AT86RF233, ATMEGARFR2, 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(), if(), NULL, 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, trx_config_params_t::rpc_enable, SET_DEFAULT_CONFIG_CONFIRM, SET_DEFAULT_CONFIG_CONFIRM_LEN, status, 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 ( 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 = 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 = 0
static

Referenced by serial_data_handler().

bool cw_ack_sent
uint8_t cw_start_mode
uint16_t cw_tmr_val
uint8_t data[SIO_RX_BUF_SIZE]
static
uint8_t data_length = 0
static

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

Referenced by serial_data_handler().

uint8_t head = 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
uint32_t param_value_t::param_value_32bit

Parameter 32-bit.

Referenced by perf_get_req(), and perf_set_req().

uint64_t param_value_t::param_value_64bit

Parameter 64-bit.

float param_value_t::param_value_float
uint32_t pkt_stream_gap_time
bool pulse_mode
bool remote_cmd_rcvd = false

This flag is used to check if a remote_test command has been received or not.

Referenced by handle_incoming_msg(), and serial_data_handler().

bool remote_cw_start
bool remote_pulse_cw_start
uint8_t rx_index = 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[SIO_RX_BUF_SIZE]
static

This is the receive buffer of the UART.

Referenced by convert_ota_serial_frame_rx(), handle_incoming_msg(), and process_incoming_sio_data().

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