Microchip® Advanced Software Framework

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

This Module handles the Functionalities of Configuration Mode.

Macros

#define CONFIG_MODE_TX_PWR   (0xB5)
 Lowest power -11 dBm. More...
 

Functions

static void app_peer_req_tmr_handler_cb (void *parameter)
 Timer handler for supporting peer search. More...
 
static void configuration_mode_selection (void)
 Checks whether Configuartion Mode is selected or not. More...
 
static void peer_req_send_exit ()
 function to exit peer req send state More...
 
static void peer_req_send_rx_cb (frame_info_t *mac_frame_info)
 Callback that is called if data has been received by trx in PEER_REQ_SEND State. More...
 
static void peer_req_send_task ()
 Application task handling peer request send. More...
 
static void peer_rsp_rcvd_exit ()
 Function to exit the peer rsp rcvd state. More...
 
static void peer_rsp_rcvd_init (void *arg)
 Peer rsp received state init function. More...
 
static void peer_rsp_rcvd_tx_cb (retval_t status, frame_info_t *frame)
 Callback that is called once tx is done in peer rsp rcvd state. More...
 
void peer_search_initiator_exit ()
 Function to exit peer search initiator exit state. More...
 
void peer_search_initiator_init (void *arg)
 Application task to start peer search. More...
 
void peer_search_initiator_rx_cb (frame_info_t *frame)
 Callback that is called if data has been received by trx. More...
 
void peer_search_initiator_set_sub_state (uint8_t state, void *arg)
 Function to set the sub state of state machine. More...
 
void peer_search_initiator_task ()
 Application task handling peer search. More...
 
void peer_search_initiator_tx_done_cb (retval_t status, frame_info_t *frame)
 Callback that is called once tx is done in peer search initiator state. More...
 
static retval_t send_peer_conf (void)
 Send the peer confirmation confirming the node which has been connected This frame is sent as a unicast to peer node. More...
 
static retval_t send_peer_req (void)
 Send peer search request. More...
 

Variables

static peer_state_function_t const peer_search_initiator_state_table [NUM_PEER_SEARCH_INITIATOR_STATES]
 
static uint8_t seq_num
 

#define CONFIG_MODE_TX_PWR   (0xB5)

Lowest power -11 dBm.

Referenced by peer_search_initiator_init().

static void app_peer_req_tmr_handler_cb ( void *  parameter)
static

Timer handler for supporting peer search.

Parameters
parameterpass parameters to timer handler

Referenced by peer_req_send_task().

static void configuration_mode_selection ( void  )
static

Checks whether Configuartion Mode is selected or not.

This will be checked during the INIT state

References button_pressed, node_ib_t::configure_mode, and node_info.

Referenced by init_state_init().

static void peer_req_send_exit ( void  )
static

function to exit peer req send state

References APP_TIMER_TO_TX, and sw_timer_stop().

static void peer_req_send_rx_cb ( frame_info_t mac_frame_info)
static

Callback that is called if data has been received by trx in PEER_REQ_SEND State.

Parameters
framePointer to received frame

References app_payload_t::cmd_id, FCS_LEN, FRAME_OVERHEAD_DST_IEEE_ADDR, LENGTH_FIELD_LEN, frame_info_tag::mpdu, peer_rsp_t::nwk_addr, app_payload_t::payload, PEER_RESPONSE, general_pkt_t::peer_rsp_data, PEER_RSP_RCVD, and peer_search_initiator_set_sub_state().

static void peer_rsp_rcvd_exit ( )
static

Function to exit the peer rsp rcvd state.

This function

  • Implements the peer search state machine.

References node_ib_t::configure_mode, node_info, phyTransmitPower, tal_pib_set(), and TAL_TRANSMIT_POWER_DEFAULT.

static void peer_rsp_rcvd_init ( void *  arg)
static
void peer_search_initiator_exit ( void  )

Function to exit peer search initiator exit state.

References node_info, and node_ib_t::sub_state.

void peer_search_initiator_init ( void *  arg)
void peer_search_initiator_rx_cb ( frame_info_t frame)

Callback that is called if data has been received by trx.

Parameters
framePointer to received frame

References node_info, and node_ib_t::sub_state.

void peer_search_initiator_set_sub_state ( uint8_t  state,
void *  arg 
)

Function to set the sub state of state machine.

Parameters
stateSub state to be set
argarguments to be set as part of set sub state

References new_state, node_info, peer_state_function_t::peer_state_exit, peer_state_function_t::peer_state_init, and node_ib_t::sub_state.

Referenced by peer_req_send_rx_cb().

void peer_search_initiator_task ( void  )

Application task handling peer search.

References node_info, and node_ib_t::sub_state.

void peer_search_initiator_tx_done_cb ( retval_t  status,
frame_info_t frame 
)

Callback that is called once tx is done in peer search initiator state.

Parameters
statusStatus of the transmission procedure
framePointer to the transmitted frame structure

References node_info, status, and node_ib_t::sub_state.

static retval_t send_peer_conf ( void  )
static

Send the peer confirmation confirming the node which has been connected This frame is sent as a unicast to peer node.

All other nodes which took part in the peer search process times out and resets peer search

References app_payload_t::cmd_id, data, FCF_SHORT_ADDR, node_info, peer_conf_t::nwk_addr, app_payload_t::payload, PEER_CONFIRM, node_ib_t::peer_short_addr, seq_num, app_payload_t::seq_num, tal_pib, and transmit_frame().

Referenced by peer_rsp_rcvd_init().

peer_state_function_t const peer_search_initiator_state_table[NUM_PEER_SEARCH_INITIATOR_STATES]
static
Initial value:
= {
{
},
{
},
}
#define NULL
Definition: def.h:47
static void peer_rsp_rcvd_init(void *arg)
Peer rsp received state init function.
Definition: peer_search_initiator.c:485
static void peer_rsp_rcvd_exit(void)
Function to exit the peer rsp rcvd state.
Definition: peer_search_initiator.c:592
static void peer_req_send_exit(void)
function to exit peer req send state
Definition: peer_search_initiator.c:405
static void peer_rsp_rcvd_tx_cb(retval_t status, frame_info_t *frame)
Callback that is called once tx is done in peer rsp rcvd state.
Definition: peer_search_initiator.c:518
static void peer_req_send_rx_cb(frame_info_t *frame)
Callback that is called if data has been received by trx in PEER_REQ_SEND State.
Definition: peer_search_initiator.c:367
static void peer_req_send_task(void)
Application task handling peer request send.
Definition: peer_search_initiator.c:289