Microchip® Advanced Software Framework

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

Initializes the Performance Analyzer Application.

Data Structures

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

Macros

#define CRC_SETTING_ON_REMOTE_NODE
 
#define DEFAULT_ADDR   (0xFFFF)
 
#define DEFAULT_CHANNEL   (DEFAULT_CHANNEL_OFFSET)
 
#define DEFAULT_PAN_ID   (0xCAFE)
 
#define DST_PAN_ID   (DEFAULT_PAN_ID)
 
#define DST_SHORT_ADDR   (0xFFFF)
 
#define DUMMY_PAYLOAD   (0xAA)
 
#define FIRMWARE_VERSION   3.2
 
#define FRAME_OVERHEAD   (11)
 
#define FRAME_OVERHEAD_DST_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define FRAME_OVERHEAD_SRC_IEEE_ADDR   (FRAME_OVERHEAD + 6)
 
#define IC_TYPE   0X00
 
#define OFFSET_FOR_SRC_IEEE_ADDR   (7)
 
#define RX_LED   LED0_GPIO
 
#define SRC_PAN_ID   (DEFAULT_PAN_ID)
 
#define STATUS_LED   LED0_GPIO
 
#define TX_LED   LED0_GPIO
 

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
}
 

Functions

void app_alert (void)
 
void config_node_ib (void)
 Function to init the information base for device. More...
 
static void configure_pibs (void)
 Configure the TAL PIB's relevant to the Performance analyzer application. 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 (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 (void *arg)
 Application task when the node is in the 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 (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_TX
 
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
 
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_RANGE
 
uint8_t node_ib_t::transmitting
 
frame_info_tnode_ib_t::tx_frame_info
 

#define CRC_SETTING_ON_REMOTE_NODE
#define DEFAULT_ADDR   (0xFFFF)

Referenced by configure_pibs().

#define DEFAULT_CHANNEL   (DEFAULT_CHANNEL_OFFSET)
#define DEFAULT_PAN_ID   (0xCAFE)
#define DST_SHORT_ADDR   (0xFFFF)
#define FIRMWARE_VERSION   3.2

Referenced by get_board_details(), and get_node_info().

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

Referenced by wait_for_event_rx_cb().

#define IC_TYPE   0X00

Referenced by get_board_details(), and get_node_info().

#define OFFSET_FOR_SRC_IEEE_ADDR   (7)

Referenced by wait_for_event_rx_cb().

#define STATUS_LED   LED0_GPIO

Referenced by app_led_event().

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 

void app_alert ( void  )

References delay_us, LED0, LED0_GPIO, and LED_Toggle.

Referenced by app_timers_init(), and init_state_init().

void config_node_ib ( void  )
static void configure_pibs ( void  )
static
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, set_main_state(), sio2host_init(), and WAIT_FOR_EVENT.

Referenced by main().

void save_all_settings ( void  )

Save all user settings before Start of CW transmission.

References ANT_DIV_DISABLE, SR_CC_BAND, SR_CC_NUMBER, tal_get_curr_trx_config(), and trx_bit_read().

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

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, LARGE_BUFFER_SIZE, 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_crc_set_req(), send_crc_status_req(), send_crc_status_rsp(), 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(), and send_set_default_config_command().

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 ( 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(), 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_TX_LED_OFF
uint8_t node_ib_t::msg_seq_num

Referenced by config_node_ib(), and transmit_frame().

volatile node_ib_t node_info

Referenced by configuration_mode_selection(), configure_frame_sending(), configure_range_test_frame_sending(), disconnect_peer_node(), handle_incoming_msg(), 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(), pulse_cw_transmission(), range_test_frame_tx(), range_test_timer_handler_cb(), rx_on_test(), send_crc_set_req(), send_crc_status_req(), send_crc_status_rsp(), 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(), serial_data_handler(), start_cw_transmission(), stop_cw_transmission(), stop_pkt_streaming(), and wait_for_conf_rx_cb().