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) |
#define | PEER_RESPONSE_TIMEOUT_IN_MICRO_SEC (200000) |
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_init (trx_id_t trx, 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... | |
static void | peer_rsp_send_tx_done_cb (trx_id_t trx, 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 (trx_id_t trx) |
Function to exit peer search receptor 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_init (trx_id_t trx, void *arg) |
Application task to start peer search. More... | |
void | peer_search_receptor_rx_cb (trx_id_t trx, 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_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 (trx_id_t trx, uint8_t state, void *arg) |
Function to set the sub state of state machine. 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 (trx_id_t trx) |
Application task handling peer search. More... | |
void | peer_search_receptor_task (void) |
Application task handling peer search. More... | |
void | peer_search_receptor_tx_done_cb (trx_id_t trx, retval_t status, frame_info_t *frame) |
Callback that is called once tx is done in peer search receptor state. 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 int | send_peer_rsp (trx_id_t trx, 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_exit (trx_id_t trx) |
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_init (trx_id_t trx, 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... | |
static void | wait_for_conf_rx_cb (trx_id_t trx, 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 peer_state_function_t const | peer_search_receptor_state_table [NUM_PEER_SEARCH_RECEPTOR_STATES] |
static uint8_t | seq_num |
static uint8_t | seq_num [NUM_TRX] |
#define PEER_RESPONSE_TIMEOUT_IN_MICRO_SEC (200000) |
Referenced by wait_for_conf_init().
#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 |
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.
|
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 | ( | trx_id_t | trx | ) |
Function to exit peer search receptor state.
This function
References node_info, and node_ib_t::sub_state.
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, pib_value_t::pib_value_16bit, REGISTER_VALUE, seq_num, tal_ext_pa_ctrl(), tal_pib_set(), and tal_set_tx_pwr().
void peer_search_receptor_init | ( | trx_id_t | trx, |
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, node_ib_t::peer_short_addr, seq_num, and tal_pib_set().
void peer_search_receptor_rx_cb | ( | trx_id_t | trx, |
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 node_info.
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 | ( | trx_id_t | trx, |
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 node_info, peer_state_function_t::peer_state_init, 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 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 | ( | trx_id_t | trx | ) |
Application task handling peer search.
This function
References node_info, and peer_state_function_t::peer_state_task.
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 | ( | trx_id_t | trx, |
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 node_info.
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 |
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_transmit_frame(), 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, and app_payload_t::seq_num.
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 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 |
Function to initialize wait for peer search conf state.
This function
References app_peer_conf_tmr_handler_cb(), APP_TIMER_TO_TX, FUNC_PTR, 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 |
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, 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, 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 |
|
static |
Referenced by peer_search_receptor_init(), and send_peer_rsp().
|
static |
Referenced by peer_search_receptor_init(), and send_peer_rsp().