Microchip® Advanced Software Framework

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

Initializes the Performance Analyzer Application.

Data Structures

struct  node_ib_t
 Structure to holds the information base for the node. More...
 

Macros

#define BOARD_NAME   "USER_BOARD"
 
#define BOARD_NAME   "USER_BOARD"
 
#define CRC_SETTING_ON_REMOTE_NODE
 
#define CRC_SETTING_ON_REMOTE_NODE
 
#define DEFAULT_ADDR   (0xFFFF)
 
#define DEFAULT_ADDR   (0xFFFF)
 
#define DEFAULT_CHANNEL   (DEFAULT_CHANNEL_OFFSET)
 
#define DEFAULT_CHANNEL_RF09   (1)
 
#define DEFAULT_CHANNEL_RF24   (21)
 
#define DEFAULT_PAN_ID   (0xCAFE)
 
#define DEFAULT_PAN_ID   (0xCAFE)
 
#define DST_PAN_ID   (DEFAULT_PAN_ID)
 
#define DST_PAN_ID   (DEFAULT_PAN_ID)
 
#define DST_SHORT_ADDR   (0xFFFF)
 
#define DST_SHORT_ADDR   (0xFFFF)
 
#define DUMMY_PAYLOAD   (0xAA)
 
#define DUMMY_PAYLOAD   (0xAA)
 
#define FIRMWARE_VERSION   3.2
 
#define FIRMWARE_VERSION   3.2
 
#define FRAME_OVERHEAD   (9)
 
#define FRAME_OVERHEAD   (11)
 
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define IC_TYPE   0x00
 
#define IC_TYPE   0X01
 
#define LED_COUNT   0
 
#define LED_COUNT   0
 
#define MCU_SOC_NAME   "USER_MCU"
 
#define MCU_SOC_NAME   "USER_MCU"
 
#define OFFSET_FOR_SRC_IEEE_ADDR   (7)
 
#define OFFSET_FOR_SRC_IEEE_ADDR   (7)
 
#define SRC_PAN_ID   (DEFAULT_PAN_ID)
 
#define SRC_PAN_ID   (DEFAULT_PAN_ID)
 
#define SUN_PAGE_NO   (0X09)
 
#define TAL_CURRENT_PAGE_DEFAULT_RF09   (0x02)
 
#define TAL_CURRENT_PAGE_DEFAULT_RF24   (0x00)
 

Enumerations

enum  main_state_t {
  INIT = 0,
  WAIT_FOR_EVENT,
  PEER_SEARCH_RANGE_TX,
  PEER_SEARCH_PER_TX,
  PEER_SEARCH_RANGE_RX,
  PEER_SEARCH_PER_RX,
  RANGE_TEST_TX_ON,
  RANGE_TEST_TX_OFF,
  SINGLE_NODE_TESTS,
  PER_TEST_INITIATOR,
  PER_TEST_RECEPTOR,
  NUM_MAIN_STATES,
  INIT = 0,
  WAIT_FOR_EVENT,
  PEER_SEARCH_RANGE_TX,
  PEER_SEARCH_PER_TX,
  PEER_SEARCH_RANGE_RX,
  PEER_SEARCH_PER_RX,
  RANGE_TEST_TX_ON,
  RANGE_TEST_TX_OFF,
  SINGLE_NODE_TESTS,
  PER_TEST_INITIATOR,
  PER_TEST_RECEPTOR,
  NUM_MAIN_STATES
}
 
enum  main_state_t {
  INIT = 0,
  WAIT_FOR_EVENT,
  PEER_SEARCH_RANGE_TX,
  PEER_SEARCH_PER_TX,
  PEER_SEARCH_RANGE_RX,
  PEER_SEARCH_PER_RX,
  RANGE_TEST_TX_ON,
  RANGE_TEST_TX_OFF,
  SINGLE_NODE_TESTS,
  PER_TEST_INITIATOR,
  PER_TEST_RECEPTOR,
  NUM_MAIN_STATES,
  INIT = 0,
  WAIT_FOR_EVENT,
  PEER_SEARCH_RANGE_TX,
  PEER_SEARCH_PER_TX,
  PEER_SEARCH_RANGE_RX,
  PEER_SEARCH_PER_RX,
  RANGE_TEST_TX_ON,
  RANGE_TEST_TX_OFF,
  SINGLE_NODE_TESTS,
  PER_TEST_INITIATOR,
  PER_TEST_RECEPTOR,
  NUM_MAIN_STATES
}
 

Functions

void app_alert (void)
 
retval_t app_transmit_frame (trx_id_t trx, uint8_t dst_addr_mode, uint8_t *dst_addr, uint8_t src_addr_mode, uint8_t msdu_handle, uint8_t *payload, uint16_t payload_length, uint8_t ack_req)
 Function to transmit frames as per 802.15.4 std. More...
 
void config_node_ib (trx_id_t trx)
 Function to init the information base for device. More...
 
void config_node_ib (void)
 Function to init the information base for device. More...
 
static void configure_pibs (trx_id_t trx)
 Configure the TAL PIB's relevant to the Performance analyzer application. More...
 
static void configure_pibs (void)
 Configure the TAL PIB's relevant to the Performance analyzer application. More...
 
void init_after_disconnect (trx_id_t trx)
 Function to perform initialization task after disconnect request. More...
 
void init_state_init (trx_id_t trx, void *arg)
 Initialization task for INIT STATE. More...
 
void init_state_init (void *arg)
 Initialization task for INIT STATE. More...
 
void performance_analyzer_init (void)
 Init function of the Performance Analyzer application. More...
 
void recover_all_settings (void)
 Recover all user settings before Start of CW transmission. More...
 
void save_all_settings (void)
 Save all user settings before Start of CW transmission. More...
 
void set_main_state (trx_id_t tranciever, main_state_t state, void *arg)
 Function to set the main state of state machine. More...
 
void set_main_state (main_state_t state, void *arg)
 Function to set the main state of state machine. More...
 
retval_t transmit_frame (uint8_t dst_addr_mode, uint8_t *dst_addr, uint8_t src_addr_mode, uint8_t msdu_handle, uint8_t *payload, uint16_t payload_length, uint8_t ack_req)
 Function to transmit frames as per 802.15.4 std. More...
 
void wait_for_event_init (trx_id_t trx, void *arg)
 Application task when the node is in the WAIT_FOR_EVENT state. More...
 
void wait_for_event_init (void *arg)
 Application task when the node is in the WAIT_FOR_EVENT state. More...
 
void wait_for_event_rx_cb (trx_id_t trx, frame_info_t *frame)
 Callback that is called if data has been received by trx in WAIT_FOR_EVENT state. More...
 
void wait_for_event_rx_cb (frame_info_t *frame)
 Callback that is called if data has been received by trx in WAIT_FOR_EVENT state. More...
 
void wait_for_event_task (trx_id_t trx)
 Application task handling user events like key press or character on UART. More...
 
void wait_for_event_task (void)
 Application task handling user events like key press or character on UART. More...
 

Variables

uint8_t APP_TIMER_TO_RX_LED_OFF
 
uint8_t APP_TIMER_TO_RX_LED_OFF
 
uint8_t APP_TIMER_TO_TX
 
uint8_t APP_TIMER_TO_TX
 
uint8_t APP_TIMER_TO_TX_LED_OFF
 
uint8_t APP_TIMER_TO_TX_LED_OFF
 
bool node_ib_t::configure_mode
 
uint8_t CW_TX_TIMER
 
main_state_t node_ib_t::main_state
 
uint8_t node_ib_t::msg_seq_num
 
volatile node_ib_t node_info [NUM_TRX]
 
volatile node_ib_t node_info
 
bool node_ib_t::peer_found
 
uint16_t node_ib_t::peer_short_addr
 
uint8_t node_ib_t::sub_state
 
uint8_t T_APP_TIMER
 
uint8_t T_APP_TIMER
 
uint8_t T_APP_TIMER_RANGE
 
uint8_t T_APP_TIMER_RANGE_RF09
 
uint8_t T_APP_TIMER_RANGE_RF24
 
uint8_t node_ib_t::transmitting
 
frame_info_tnode_ib_t::tx_frame_info
 

#define BOARD_NAME   "USER_BOARD"
#define BOARD_NAME   "USER_BOARD"
#define CRC_SETTING_ON_REMOTE_NODE
#define CRC_SETTING_ON_REMOTE_NODE
#define DEFAULT_ADDR   (0xFFFF)
#define DEFAULT_ADDR   (0xFFFF)

Referenced by configure_pibs().

#define DEFAULT_CHANNEL   (DEFAULT_CHANNEL_OFFSET)
#define DEFAULT_CHANNEL_RF09   (1)
#define DEFAULT_CHANNEL_RF24   (21)
#define DEFAULT_PAN_ID   (0xCAFE)
#define DEFAULT_PAN_ID   (0xCAFE)
#define DST_PAN_ID   (DEFAULT_PAN_ID)
#define DST_SHORT_ADDR   (0xFFFF)
#define DST_SHORT_ADDR   (0xFFFF)
#define DUMMY_PAYLOAD   (0xAA)
#define FIRMWARE_VERSION   3.2
#define FIRMWARE_VERSION   3.2

Referenced by get_board_details(), and get_node_info().

#define FRAME_OVERHEAD   (9)
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)

Referenced by peer_req_send_rx_cb().

#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)
#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)

Referenced by wait_for_event_rx_cb().

#define IC_TYPE   0x00
#define IC_TYPE   0X01

Referenced by get_board_details(), and get_node_info().

#define LED_COUNT   0
#define LED_COUNT   0

Referenced by appDataInd().

#define MCU_SOC_NAME   "USER_MCU"
#define MCU_SOC_NAME   "USER_MCU"

Referenced by get_board_details(), and get_node_info().

#define OFFSET_FOR_SRC_IEEE_ADDR   (7)
#define OFFSET_FOR_SRC_IEEE_ADDR   (7)

Referenced by wait_for_event_rx_cb().

#define SRC_PAN_ID   (DEFAULT_PAN_ID)
#define SUN_PAGE_NO   (0X09)
#define TAL_CURRENT_PAGE_DEFAULT_RF09   (0x02)
#define TAL_CURRENT_PAGE_DEFAULT_RF24   (0x00)

Enumerator
INIT 
WAIT_FOR_EVENT 
PEER_SEARCH_RANGE_TX 
PEER_SEARCH_PER_TX 
PEER_SEARCH_RANGE_RX 
PEER_SEARCH_PER_RX 
RANGE_TEST_TX_ON 
RANGE_TEST_TX_OFF 
SINGLE_NODE_TESTS 
PER_TEST_INITIATOR 
PER_TEST_RECEPTOR 
NUM_MAIN_STATES 
INIT 
WAIT_FOR_EVENT 
PEER_SEARCH_RANGE_TX 
PEER_SEARCH_PER_TX 
PEER_SEARCH_RANGE_RX 
PEER_SEARCH_PER_RX 
RANGE_TEST_TX_ON 
RANGE_TEST_TX_OFF 
SINGLE_NODE_TESTS 
PER_TEST_INITIATOR 
PER_TEST_RECEPTOR 
NUM_MAIN_STATES 
Enumerator
INIT 
WAIT_FOR_EVENT 
PEER_SEARCH_RANGE_TX 
PEER_SEARCH_PER_TX 
PEER_SEARCH_RANGE_RX 
PEER_SEARCH_PER_RX 
RANGE_TEST_TX_ON 
RANGE_TEST_TX_OFF 
SINGLE_NODE_TESTS 
PER_TEST_INITIATOR 
PER_TEST_RECEPTOR 
NUM_MAIN_STATES 
INIT 
WAIT_FOR_EVENT 
PEER_SEARCH_RANGE_TX 
PEER_SEARCH_PER_TX 
PEER_SEARCH_RANGE_RX 
PEER_SEARCH_PER_RX 
RANGE_TEST_TX_ON 
RANGE_TEST_TX_OFF 
SINGLE_NODE_TESTS 
PER_TEST_INITIATOR 
PER_TEST_RECEPTOR 
NUM_MAIN_STATES 

void app_alert ( void  )
retval_t app_transmit_frame ( trx_id_t  trx,
uint8_t  dst_addr_mode,
uint8_t *  dst_addr,
uint8_t  src_addr_mode,
uint8_t  msdu_handle,
uint8_t *  payload,
uint16_t  payload_length,
uint8_t  ack_req 
)

Function to transmit frames as per 802.15.4 std.

Parameters
dst_addr_modedestination address mode - can be 16 or 64 bit
dst_addrdestination address
src_addr_modesource address mode - can be 16 or 64 bit
msdu_handlemsdu handle for the upper layers to track packets
payloaddata payload pointer
payload_lengthdata length
ack_reqspecifies ack requested for frame if set to 1
Returns
MAC_SUCCESS if the TAL has accepted the data for frame transmission TAL_BUSY if the TAL is busy servicing the previous tx request

References CCPU_ENDIAN_TO_LE16, convert_16_bit_to_byte_array(), convert_64_bit_to_byte_array(), CSMA_UNSLOTTED, DST_PAN_ID, EXT_ADDR_LEN, FAILURE, FCF_2_SOURCE_ADDR_OFFSET, FCF_ACK_REQUEST, FCF_FRAMETYPE_DATA, FCF_LEN, FCF_LONG_ADDR, FCF_PAN_ID_COMPRESSION, FCF_SET_DEST_ADDR_MODE, FCF_SET_SOURCE_ADDR_MODE, FCF_SHORT_ADDR, frame_info_tag::mpdu, frame_info_tag::msduHandle, node_ib_t::msg_seq_num, PAN_ID_LEN, PL_POS_DST_ADDR_START, SHORT_ADDR_LEN, SRC_PAN_ID, tal_pib, tal_tx_frame(), node_ib_t::transmitting, and node_ib_t::tx_frame_info.

Referenced by range_test_frame_tx(), send_disconnect_command(), send_identify_command(), send_parameters_changed(), send_peer_conf(), send_peer_info_req(), send_peer_info_rsp(), send_peer_req(), send_peer_rsp(), send_per_test_start_cmd(), send_range_test_marker_cmd(), send_range_test_marker_rsp(), send_range_test_rsp(), send_range_test_start_cmd(), send_range_test_stop_cmd(), send_result_req(), send_result_rsp(), send_set_default_config_command(), and send_sun_page_changed().

void config_node_ib ( trx_id_t  trx)
void config_node_ib ( void  )
static void configure_pibs ( trx_id_t  trx)
static

Configure the TAL PIB's relevant to the Performance analyzer application.

References CCPU_ENDIAN_TO_LE16, DEFAULT_ADDR, DEFAULT_CHANNEL_RF09, DEFAULT_CHANNEL_RF24, macIeeeAddress, macPANId, macShortAddress, phyCurrentChannel, RF09, SRC_PAN_ID, tal_pib, and tal_pib_set().

Referenced by wait_for_event_init().

static void configure_pibs ( void  )
static
void init_state_init ( trx_id_t  trx,
void *  arg 
)
void init_state_init ( void *  arg)

Initialization task for INIT STATE.

All hardware, PAL, TAL and stack level initialization must be done in this function

Parameters
argarguments for INIT state

References ANT_CTRL_1, ANT_DIVERSITY_DISABLE, app_alert(), app_timers_init(), config_node_ib(), configuration_mode_selection(), init_sio(), MAC_SUCCESS, sw_timer_init(), tal_ant_div_config(), and tal_init().

void performance_analyzer_init ( void  )

Init function of the Performance Analyzer application.

References INIT, NULL, set_main_state(), sio2host_init(), and WAIT_FOR_EVENT.

Referenced by main().

void recover_all_settings ( void  )

Recover all user settings before Start of CW transmission.

Referenced by set_transceiver_state().

void save_all_settings ( void  )

Save all user settings before Start of CW transmission.

Referenced by set_transceiver_state().

void set_main_state ( trx_id_t  tranciever,
main_state_t  state,
void *  arg 
)

Function to set the main state of state machine.

Parameters
statemain state to be set
argargument passed in the state

References state_function_t::func_main_state_exit, state_function_t::func_main_state_init, state_function_t::func_sub_state_set, node_ib_t::main_state, state, and node_ib_t::transmitting.

retval_t transmit_frame ( uint8_t  dst_addr_mode,
uint8_t *  dst_addr,
uint8_t  src_addr_mode,
uint8_t  msdu_handle,
uint8_t *  payload,
uint16_t  payload_length,
uint8_t  ack_req 
)

Function to transmit frames as per 802.15.4 std.

Parameters
dst_addr_modedestination address mode - can be 16 or 64 bit
dst_addrdestination address
src_addr_modesource address mode - can be 16 or 64 bit
msdu_handlemsdu handle for the upper layers to track packets
payloaddata payload pointer
payload_lengthdata length
ack_reqspecifies ack requested for frame if set to 1
Returns
MAC_SUCCESS if the TAL has accepted the data for frame transmission TAL_BUSY if the TAL is busy servicing the previous tx request

References CCPU_ENDIAN_TO_LE16, convert_16_bit_to_byte_array(), convert_64_bit_to_byte_array(), CSMA_UNSLOTTED, DST_PAN_ID, EXT_ADDR_LEN, FAILURE, FCF_2_SOURCE_ADDR_OFFSET, FCF_ACK_REQUEST, FCF_FRAMETYPE_DATA, FCF_LEN, FCF_LONG_ADDR, FCF_PAN_ID_COMPRESSION, FCF_SET_DEST_ADDR_MODE, FCF_SET_SOURCE_ADDR_MODE, FCF_SHORT_ADDR, FCS_LEN, FRAME_OVERHEAD, frame_info_tag::mpdu, frame_info_tag::msduHandle, node_ib_t::msg_seq_num, PAN_ID_LEN, PL_POS_DST_ADDR_START, SHORT_ADDR_LEN, SRC_PAN_ID, tal_pib, tal_tx_frame(), node_ib_t::transmitting, and node_ib_t::tx_frame_info.

Referenced by cca_start(), continue_deferred_transmission(), csma_start(), handle_gts_data_req(), mac_tx_gts_data(), mcps_data_request(), mlme_gts_request(), process_deallocate_data_q(), range_test_frame_tx(), send_disconnect_command(), send_identify_command(), send_parameters_changed(), send_peer_conf(), send_peer_info_req(), send_peer_info_rsp(), send_peer_req(), send_peer_rsp(), send_per_test_start_cmd(), send_range_test_marker_cmd(), send_range_test_marker_rsp(), send_range_test_rsp(), send_range_test_start_cmd(), send_range_test_stop_cmd(), send_remote_cmd(), send_remote_reply_cmd(), send_result_req(), send_result_rsp(), send_set_default_config_command(), tal_tx_frame(), and tx_done_handling().

void wait_for_event_init ( trx_id_t  trx,
void *  arg 
)

Application task when the node is in the WAIT_FOR_EVENT state.

Parameters
argarguments for WAIT_FOR_EVENT state

References app_led_event(), configure_pibs(), LED_EVENT_POWER_ON, PHY_RX_ON, RF09, RF24, and tal_rx_enable().

void wait_for_event_init ( void *  arg)

Application task when the node is in the WAIT_FOR_EVENT state.

Parameters
argarguments for WAIT_FOR_EVENT state

References app_led_event(), configure_pibs(), LED_EVENT_POWER_ON, PHY_RX_ON, and tal_rx_enable().

void wait_for_event_task ( trx_id_t  trx)

Application task handling user events like key press or character on UART.

This function

  • Implements the event handling in WAIT_FOR_EVENT state.

References app_debounce_button(), NULL, PEER_SEARCH_RANGE_TX, print_event(), PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR, and set_main_state().

void wait_for_event_task ( void  )

Application task handling user events like key press or character on UART.

This function

  • Implements the event handling in WAIT_FOR_EVENT state.

References app_debounce_button(), NULL, PEER_SEARCH_RANGE_TX, print_event(), PRINT_KEY_PRESS_PEER_SEARCH_INITIATOR, and set_main_state().

uint8_t APP_TIMER_TO_RX_LED_OFF

Referenced by app_led_event(), and app_timers_init().

uint8_t APP_TIMER_TO_RX_LED_OFF
uint8_t APP_TIMER_TO_TX
uint8_t APP_TIMER_TO_TX_LED_OFF
uint8_t APP_TIMER_TO_TX_LED_OFF
uint8_t node_ib_t::msg_seq_num
volatile node_ib_t node_info[NUM_TRX]

Referenced by configuration_mode_selection(), configure_frame_sending(), configure_range_test_frame_sending(), disconnect_peer_node(), handle_incoming_msg(), init_after_disconnect(), peer_req_send_task(), peer_rsp_rcvd_exit(), peer_rsp_rcvd_init(), peer_rsp_rcvd_tx_cb(), peer_search_initiator_exit(), peer_search_initiator_init(), peer_search_initiator_rx_cb(), peer_search_initiator_set_sub_state(), peer_search_initiator_task(), peer_search_initiator_tx_done_cb(), peer_search_receptor_exit(), peer_search_receptor_init(), peer_search_receptor_rx_cb(), peer_search_receptor_set_sub_state(), peer_search_receptor_task(), peer_search_receptor_tx_done_cb(), per_mode_initiator_init(), per_mode_initiator_task(), per_mode_initiator_tx_done_cb(), per_mode_receptor_task(), per_mode_receptor_tx_done_cb(), pktstream_test(), range_test_frame_tx(), range_test_timer_handler_cb(), range_test_timer_handler_rf09_cb(), range_test_timer_handler_rf24_cb(), rx_on_test(), send_disconnect_command(), send_identify_command(), send_parameters_changed(), send_peer_conf(), send_peer_info_req(), send_peer_info_rsp(), send_peer_req(), send_peer_rsp(), send_per_test_start_cmd(), send_range_test_marker_cmd(), send_range_test_marker_rsp(), send_range_test_rsp(), send_range_test_start_cmd(), send_range_test_stop_cmd(), send_remote_cmd(), send_remote_reply_cmd(), send_result_req(), send_result_rsp(), send_set_default_config_command(), send_sun_page_changed(), serial_data_handler(), stop_pkt_streaming(), and wait_for_conf_rx_cb().

volatile node_ib_t node_info
uint8_t T_APP_TIMER