This module handles the Peer search Receptor Process.
Modules | |
Peer Search Initiator | |
This module handles the Peer search Initiation Process. | |
Macros | |
#define | PEER_RESPONSE_TIMEOUT_IN_MICRO_SEC (200000) |
Enumerations | |
enum | peer_search_receptor_state_t { PEER_RSP_SEND, WAIT_FOR_PEER_CONF, PEER_SEARCH_RECEPTOR_SUCCESS, NUM_PEER_SEARCH_RECEPTOR_STATES } |
Functions | |
static void | app_peer_conf_tmr_handler_cb (void *parameter) |
Timer handler for supporting peer search. More... | |
static void | peer_rsp_send_init (void *arg) |
Application task handling peer search. More... | |
static void | peer_rsp_send_tx_done_cb (retval_t status, frame_info_t *frame) |
Callback that is called once tx is done in PEER_RSP_SEND state. More... | |
void | peer_search_receptor_exit (void) |
Function to exit peer search receptor state. More... | |
void | peer_search_receptor_init (void *arg) |
Application task to start peer search. More... | |
void | peer_search_receptor_rx_cb (frame_info_t *frame) |
Callback that is called if data has been received by trx in peer search receptor state. More... | |
void | peer_search_receptor_set_sub_state (uint8_t state, void *arg) |
Function to set the sub state of state machine. More... | |
void | peer_search_receptor_task (void) |
Application task handling peer search. More... | |
void | peer_search_receptor_tx_done_cb (retval_t status, frame_info_t *frame) |
Callback that is called once tx is done in peer search receptor state. More... | |
static int | send_peer_rsp (uint64_t *dst_addr) |
Send peer response. More... | |
static void | wait_for_conf_exit (void) |
Function to exit wait for peer search conf state. More... | |
static void | wait_for_conf_init (void *arg) |
Function to initialize wait for peer search conf state. More... | |
static void | wait_for_conf_rx_cb (frame_info_t *mac_frame_info) |
Callback that is called once tx is done in wait for peer search conf state. More... | |
Variables | |
static peer_state_function_t const | peer_search_receptor_state_table [NUM_PEER_SEARCH_RECEPTOR_STATES] |
static uint8_t | seq_num |
#define PEER_RESPONSE_TIMEOUT_IN_MICRO_SEC (200000) |
Referenced by wait_for_conf_init().
|
static |
Timer handler for supporting peer search.
parameter | pass parameters to timer handler |
References print_event(), PRINT_PEER_SEARCH_FAILED, set_main_state(), and WAIT_FOR_EVENT.
Referenced by wait_for_conf_init().
|
static |
Application task handling peer search.
This function
References peer_search_receptor_arg_t::peer_ieee_addr, print_event(), PRINT_PEER_SEARCH_FAILED, send_peer_rsp(), set_main_state(), and WAIT_FOR_EVENT.
|
static |
Callback that is called once tx is done in PEER_RSP_SEND state.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References MAC_SUCCESS, peer_search_receptor_set_sub_state(), print_event(), PRINT_PEER_SEARCH_FAILED, set_main_state(), WAIT_FOR_EVENT, and WAIT_FOR_PEER_CONF.
void peer_search_receptor_exit | ( | void | ) |
Function to exit peer search receptor state.
This function
References node_info, and node_ib_t::sub_state.
void peer_search_receptor_init | ( | void * | arg | ) |
Application task to start peer search.
arg | Pointer to the arguments to be carried, if any |
References app_led_event(), LED_EVENT_START_PEER_SEARCH, macShortAddress, peer_search_receptor_arg_t::my_short_addr, node_info, PA_EXT_DISABLE, node_ib_t::peer_short_addr, REGISTER_VALUE, seq_num, and tal_pib_set().
void peer_search_receptor_rx_cb | ( | frame_info_t * | frame | ) |
Callback that is called if data has been received by trx in peer search receptor state.
frame | Pointer to received frame |
References if(), node_info, and node_ib_t::sub_state.
void peer_search_receptor_set_sub_state | ( | uint8_t | state, |
void * | arg | ||
) |
Function to set the sub state of state machine.
state | Sub state to which the Peer search receptor to be entered |
arg | Pointer to the arguments to be carried, if any |
References new_state, node_info, peer_state_function_t::peer_state_init, and node_ib_t::sub_state.
Referenced by peer_rsp_send_tx_done_cb().
void peer_search_receptor_task | ( | void | ) |
Application task handling peer search.
This function
References if(), node_info, peer_state_function_t::peer_state_task, and node_ib_t::sub_state.
void peer_search_receptor_tx_done_cb | ( | retval_t | status, |
frame_info_t * | frame | ||
) |
Callback that is called once tx is done in peer search receptor state.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References if(), node_info, and node_ib_t::sub_state.
|
static |
Send peer response.
This is a unicast send to the node which had earlier send the peer request
src_addr | The address which had been sent as payload of peer request it becomes the source address of node which sent peer rsp |
seq_num | Sequence number of the Peer request frame |
References app_payload_t::cmd_id, data, FCF_LONG_ADDR, FCF_SHORT_ADDR, node_info, peer_rsp_t::nwk_addr, app_payload_t::payload, PEER_RESPONSE, node_ib_t::peer_short_addr, seq_num, app_payload_t::seq_num, and transmit_frame().
Referenced by peer_rsp_send_init().
|
static |
Function to exit wait for peer search conf state.
This function
References APP_TIMER_TO_TX, and sw_timer_stop().
|
static |
Function to initialize wait for peer search conf state.
This function
References app_peer_conf_tmr_handler_cb(), APP_TIMER_TO_TX, FUNC_PTR, NULL, PEER_RESPONSE_TIMEOUT_IN_MICRO_SEC, SW_TIMEOUT_RELATIVE, and sw_timer_start().
|
static |
Callback that is called once tx is done in wait for peer search conf state.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References app_led_event(), app_payload_t::cmd_id, FRAME_OVERHEAD, INIT, LED_EVENT_PEER_SEARCH_DONE, node_ib_t::main_state, frame_info_tag::mpdu, node_info, NUM_MAIN_STATES, peer_conf_t::nwk_addr, app_payload_t::payload, general_pkt_t::peer_conf_data, PEER_CONFIRM, PEER_SEARCH_PER_RX, PEER_SEARCH_PER_TX, PEER_SEARCH_RANGE_RX, PEER_SEARCH_RANGE_TX, node_ib_t::peer_short_addr, PER_TEST_INITIATOR, PER_TEST_RECEPTOR, print_event(), PRINT_PEER_SEARCH_SUCCESS, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, set_main_state(), SINGLE_NODE_TESTS, and WAIT_FOR_EVENT.
|
static |
|
static |
Referenced by peer_search_receptor_init(), and send_peer_rsp().