This Module handles the Functionalities of Configuration Mode.
Macros | |
#define | CONFIG_MODE_TX_PWR (0xEF) |
Lowest power -17dBm. More... | |
#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 | configuration_mode_selection (trx_id_t trx) |
Checks whether Configuration Mode is selected or not. More... | |
static void | peer_req_send_exit (trx_id_t trx) |
function to exit peer req send state More... | |
static void | peer_req_send_exit () |
function to exit peer req send state More... | |
static void | peer_req_send_rx_cb (trx_id_t trx, 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_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 (trx_id_t trx) |
Application task handling peer request send. More... | |
static void | peer_req_send_task () |
Application task handling peer request send. More... | |
static void | peer_rsp_rcvd_exit (trx_id_t trx) |
Function to exit the peer rsp rcvd state. More... | |
static void | peer_rsp_rcvd_exit () |
Function to exit the peer rsp rcvd state. More... | |
static void | peer_rsp_rcvd_init (trx_id_t trx, void *arg) |
Peer rsp received state init function. More... | |
static void | peer_rsp_rcvd_init (void *arg) |
Peer rsp received state init function. More... | |
static void | peer_rsp_rcvd_tx_cb (trx_id_t trx, retval_t status, frame_info_t *frame) |
Callback that is called once tx is done in peer rsp rcvd state. 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 (trx_id_t trx) |
Function to exit peer search initiator exit state. More... | |
void | peer_search_initiator_exit () |
Function to exit peer search initiator exit state. More... | |
void | peer_search_initiator_init (trx_id_t trx, void *arg) |
Application task to start peer search. More... | |
void | peer_search_initiator_init (void *arg) |
Application task to start peer search. More... | |
void | peer_search_initiator_rx_cb (trx_id_t trx, frame_info_t *frame) |
Callback that is called if data has been received by trx. 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 (trx_id_t trx, uint8_t state, void *arg) |
Function to set the sub state of state machine. 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 (trx_id_t trx) |
Application task handling peer search. More... | |
void | peer_search_initiator_task () |
Application task handling peer search. More... | |
void | peer_search_initiator_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 initiator state. 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 (trx_id_t trx) |
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_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 (trx_id_t trx) |
Send peer search request. 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 peer_state_function_t const | peer_search_initiator_state_table [NUM_PEER_SEARCH_INITIATOR_STATES] |
static uint8_t | seq_num [NUM_TRX] |
static uint8_t | seq_num |
#define CONFIG_MODE_TX_PWR (0xEF) |
Lowest power -17dBm.
Referenced by peer_search_initiator_init().
#define CONFIG_MODE_TX_PWR (0xB5) |
Lowest power -11 dBm.
Referenced by peer_search_initiator_init().
|
static |
Timer handler for supporting peer search.
parameter | pass parameters to timer handler |
Referenced by peer_req_send_task().
|
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 |
Checks whether Configuration 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_after_disconnect(), and init_state_init().
|
static |
function to exit peer req send state
References APP_TIMER_TO_TX, and sw_timer_stop().
|
static |
function to exit peer req send state
References APP_TIMER_TO_TX, and sw_timer_stop().
|
static |
Callback that is called if data has been received by trx in PEER_REQ_SEND State.
frame | Pointer to received frame |
References app_payload_t::cmd_id, FRAME_OVERHEAD_DST_IEEE_ADDR, 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 |
Callback that is called if data has been received by trx in PEER_REQ_SEND State.
frame | Pointer 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 |
Application task handling peer request send.
References app_peer_req_tmr_handler_cb(), APP_TIMER_TO_TX, FUNC_PTR, INIT, MAX_NUMBER_PEER_REQ_RETRY, node_info, NULL, NUM_MAIN_STATES, PEER_REQUEST_SEND_INTERVAL_IN_MICRO_SEC, 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_FAILED, PRINT_PEER_SEARCH_IN_PROGRESS, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, send_peer_req(), set_main_state(), SINGLE_NODE_TESTS, SW_TIMEOUT_RELATIVE, sw_timer_is_running(), sw_timer_start(), and WAIT_FOR_EVENT.
|
static |
Application task handling peer request send.
References app_peer_req_tmr_handler_cb(), APP_TIMER_TO_TX, node_ib_t::configure_mode, FUNC_PTR, INIT, node_ib_t::main_state, MAX_NUMBER_PEER_REQ_RETRY, node_info, NULL, NUM_MAIN_STATES, PEER_REQUEST_SEND_INTERVAL_IN_MICRO_SEC, 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_FAILED, PRINT_PEER_SEARCH_IN_PROGRESS, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, send_peer_req(), set_main_state(), SINGLE_NODE_TESTS, SW_TIMEOUT_RELATIVE, sw_timer_is_running(), sw_timer_start(), and WAIT_FOR_EVENT.
|
static |
Function to exit the peer rsp rcvd state.
This function
References node_ib_t::configure_mode, node_info, phyTransmitPower, tal_pib_set(), and TAL_TRANSMIT_POWER_DEFAULT.
|
static |
Function to exit the peer rsp rcvd state.
This function
References node_ib_t::configure_mode, node_info, phyTransmitPower, pib_value_t::pib_value_8bit, tal_pib_set(), and TAL_TRANSMIT_POWER_DEFAULT.
|
static |
Peer rsp received state init function.
References macShortAddress, NO_PEER_FOUND, node_info, NUL_VAL, NULL, PEER_SEARCH_PER_TX, PEER_SEARCH_RANGE_TX, print_event(), PRINT_PEER_SEARCH_FAILED, send_peer_conf(), set_main_state(), START_MODE_PER, tal_pib_set(), usr_perf_start_confirm(), and WAIT_FOR_EVENT.
|
static |
Peer rsp received state init function.
References macShortAddress, node_ib_t::main_state, NO_PEER_FOUND, node_info, NUL_VAL, NULL, PEER_SEARCH_PER_TX, PEER_SEARCH_RANGE_TX, print_event(), PRINT_PEER_SEARCH_FAILED, send_peer_conf(), set_main_state(), START_MODE_PER, tal_pib_set(), usr_perf_start_confirm(), and WAIT_FOR_EVENT.
|
static |
Callback that is called once tx is done in peer rsp rcvd state.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References app_led_event(), INIT, LED_EVENT_PEER_SEARCH_DONE, MAC_SUCCESS, NO_PEER_FOUND, node_info, NUL_VAL, NULL, NUM_MAIN_STATES, node_ib_t::peer_found, 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_FAILED, PRINT_PEER_SEARCH_SUCCESS, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, set_main_state(), SINGLE_NODE_TESTS, START_MODE_PER, usr_perf_start_confirm(), and WAIT_FOR_EVENT.
|
static |
Callback that is called once tx is done in peer rsp rcvd state.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References app_led_event(), INIT, LED_EVENT_PEER_SEARCH_DONE, MAC_SUCCESS, node_ib_t::main_state, NO_PEER_FOUND, node_info, NUL_VAL, NULL, NUM_MAIN_STATES, node_ib_t::peer_found, 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_FAILED, PRINT_PEER_SEARCH_SUCCESS, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, set_main_state(), SINGLE_NODE_TESTS, START_MODE_PER, usr_perf_start_confirm(), and WAIT_FOR_EVENT.
void peer_search_initiator_exit | ( | trx_id_t | trx | ) |
Function to exit peer search initiator exit state.
References node_info, peer_state_function_t::peer_state_exit, and node_ib_t::sub_state.
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 | ( | trx_id_t | trx, |
void * | arg | ||
) |
Application task to start peer search.
arg | arguments to start the peer search |
References app_led_event(), CONFIG_MODE_TX_PWR, LED_EVENT_START_PEER_SEARCH, node_info, PEER_SEARCH_RANGE_TX, node_ib_t::peer_short_addr, phyTransmitPower, print_event(), PRINT_PEER_SEARCH_INITATED, seq_num, and tal_pib_set().
void peer_search_initiator_init | ( | void * | arg | ) |
Application task to start peer search.
arg | arguments to start the peer search |
References app_led_event(), CONFIG_MODE_TX_PWR, node_ib_t::configure_mode, LED_EVENT_START_PEER_SEARCH, node_ib_t::main_state, node_info, PA_EXT_DISABLE, PEER_SEARCH_RANGE_TX, node_ib_t::peer_short_addr, phyTransmitPower, pib_value_t::pib_value_8bit, print_event(), PRINT_PEER_SEARCH_INITATED, REGISTER_VALUE, seq_num, tal_ext_pa_ctrl(), tal_pib_set(), and tal_set_tx_pwr().
void peer_search_initiator_rx_cb | ( | trx_id_t | trx, |
frame_info_t * | frame | ||
) |
Callback that is called if data has been received by trx.
frame | Pointer to received frame |
References node_info.
void peer_search_initiator_rx_cb | ( | frame_info_t * | frame | ) |
Callback that is called if data has been received by trx.
frame | Pointer to received frame |
References node_info, and node_ib_t::sub_state.
void peer_search_initiator_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 be set |
arg | arguments to be set as part of set sub state |
References node_info, peer_state_function_t::peer_state_exit, peer_state_function_t::peer_state_init, 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.
state | Sub state to be set |
arg | arguments to be set as part of set sub state |
References 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 | ( | trx_id_t | trx | ) |
Application task handling peer search.
References node_info.
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 | ( | trx_id_t | trx, |
retval_t | status, | ||
frame_info_t * | frame | ||
) |
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.
status | Status of the transmission procedure |
frame | Pointer to the transmitted frame structure |
References node_info, status, and node_ib_t::sub_state.
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_transmit_frame(), 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, and tal_pib.
Referenced by peer_rsp_rcvd_init().
|
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().
Send peer search request.
References app_transmit_frame(), BROADCAST, app_payload_t::cmd_id, peer_req_t::config_mode, node_ib_t::configure_mode, data, FCF_LONG_ADDR, FCF_SHORT_ADDR, INIT, node_info, NUM_MAIN_STATES, peer_req_t::nwk_addr, peer_req_t::op_mode, app_payload_t::payload, PEER_REQUEST, 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_MODE, PER_TEST_RECEPTOR, RANGE_MEASURE_MODE, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, seq_num, app_payload_t::seq_num, SINGLE_NODE_TESTS, and WAIT_FOR_EVENT.
Referenced by peer_req_send_task().
|
static |
Send peer search request.
References BROADCAST, app_payload_t::cmd_id, peer_req_t::config_mode, node_ib_t::configure_mode, data, FCF_LONG_ADDR, FCF_SHORT_ADDR, INIT, node_ib_t::main_state, node_info, NUM_MAIN_STATES, peer_req_t::nwk_addr, peer_req_t::op_mode, app_payload_t::payload, PEER_REQUEST, 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_MODE, PER_TEST_RECEPTOR, RANGE_MEASURE_MODE, RANGE_TEST_TX_OFF, RANGE_TEST_TX_ON, seq_num, app_payload_t::seq_num, SINGLE_NODE_TESTS, transmit_frame(), and WAIT_FOR_EVENT.
Referenced by peer_req_send_task().
|
static |
|
static |
|
static |
Referenced by peer_search_initiator_init(), send_peer_conf(), and send_peer_req().
|
static |
Referenced by peer_search_initiator_init(), send_peer_conf(), send_peer_req(), and send_range_test_rsp().