Microchip® Advanced Software Framework

src/peer_search_initiator.c File Reference
#include <stdlib.h>
#include "tal.h"
#include "tal_constants.h"
#include "tal_helper.h"
#include "ieee_const.h"
#include "sio2host.h"
#include "app_frame_format.h"
#include "app_init.h"
#include "app_peer_search.h"
#include "perf_api.h"

Macros

#define CONFIG_MODE_TX_PWR   (0xB5)
 Lowest power -11 dBm. More...
 
#define MAX_NUMBER_PEER_REQ_RETRY   (0xFF)
 
#define PEER_REQUEST_SEND_INTERVAL_IN_MICRO_SEC   (50000)
 

Enumerations

enum  peer_search_initiator_state_t {
  PEER_REQ_SEND,
  PEER_RSP_RCVD,
  NUM_PEER_SEARCH_INITIATOR_STATES,
  PEER_REQ_SEND,
  PEER_RSP_RCVD,
  NUM_PEER_SEARCH_INITIATOR_STATES
}
 

Functions

static void app_peer_req_tmr_handler_cb (void *parameter)
 Timer handler for supporting peer search. 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