Microchip® Advanced Software Framework

2/src/per_mode_receptor.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include "app_init.h"
#include "sio2host.h"
#include "tal_pib.h"
#include "tal_helper_2.h"
#include "ieee_const.h"
#include "app_frame_format.h"
#include "app_per_mode.h"
#include "conf_board.h"
#include "led.h"
#include "perf_api.h"
#include "user_interface.h"

Macros

#define DELAY_BEFORE_APP_RESET_IN_MICRO_SEC   (5000)
 
#define LED_BLINK_COUNT_FOR_BUTTON_PRESS   (10)
 
#define LED_BLINK_COUNT_FOR_IDENTIFY   (20)
 

Functions

static void app_reset_cb (void *parameter)
 Timer Callback function if disconnect command is received on air by a node in reflector configuration.This is used to do a software reset on the reflector side. More...
 
static void get_node_info (trx_id_t trx, peer_info_rsp_t *data)
 Function used to get the board details of peer node. More...
 
static void identify_timer_handler_cb (void *parameter)
 Timer Callback function if identify command is received on air by a node in reflector configuration. More...
 
void marker_rsp_timer_handler_cb (void *parameter)
 Timer Callback function if marker command is received on air This is used to blink the LED and thus identify that the marker frame is received. More...
 
void marker_tx_timer_handler_cb (void *parameter)
 Timer Callback function if marker response command is transmitted on air This is used to blink the LED and thus identify that the transmission is done. More...
 
void per_mode_receptor_init (trx_id_t trx, void *parameter)
 Initialize the application in PER Measurement mode as Receptor. More...
 
void per_mode_receptor_rx_cb (trx_id_t trx, frame_info_t *frame)
 Callback that is called if data has been received by trx in the PER_TEST_RECEPTOR state This call back is used when the node is operating as PER Measurement mode Receptor. More...
 
void per_mode_receptor_task (trx_id_t trx)
 The application task when the node is in PER_TEST_RECEPTOR state i.e.PER Measurement mode as Receptor. More...
 
void per_mode_receptor_tx_done_cb (trx_id_t trx, retval_t status, frame_info_t *frame)
 Callback that is called once tx is done in PER_TEST_RECEPTOR state This call back is used when the node is operating as PER Measurement mode Receptor. More...
 
static void send_peer_info_rsp (trx_id_t trx)
 Function used to send peer_info_rsp command. More...
 
static bool send_range_test_marker_cmd (trx_id_t trx)
 Function to send the range test marker command to the initiator node. More...
 
static void send_range_test_rsp (trx_id_t trx, uint8_t seq_num, uint32_t frame_count, int8_t ed, uint8_t lqi)
 Function used to send response to the received range test packet. More...
 
static void send_result_rsp (trx_id_t trx)
 Function used to send PER test result. More...
 
static void set_default_configuration_peer_node (trx_id_t trx)
 Function used to set default configurations on peer node on reception of set_default req. More...
 
static void set_paramter_on_recptor_node (trx_id_t trx, app_payload_t *msg)
 Extract the received command frame and set the parameters like channel, tx power etc on Receptor node. More...
 

Variables

static uint32_t aver_lqi [NUM_TRX]
 
static uint32_t aver_rssi [NUM_TRX]
 
static uint8_t marker_seq_num [NUM_TRX] = {0, 0}
 
static uint32_t number_rx_frames [NUM_TRX]
 
static bool range_test_in_progress [NUM_TRX] = {false, false}
 
static uint8_t seq_num_receptor [NUM_TRX]
 

static void app_reset_cb ( void *  parameter)
static

Timer Callback function if disconnect command is received on air by a node in reflector configuration.This is used to do a software reset on the reflector side.

Parameters
parameterpass parameters to timer handler

References app_reset().

Referenced by per_mode_receptor_rx_cb().