Microchip® Advanced Software Framework

serial_if_sniffer.c File Reference

PRIME Embedded Sniffer Serial Interface.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <string.h>
#include "compiler.h"
#include "serial_if_sniffer.h"
#include <mngl.h>
#include <prime.h>
#include <usi.h>
#include <pal.h>

Macros

#define _pack_ul(ul_data)
 
#define _pack_us(us_data)
 
#define MAC_HEADER_SIZE   7
 
#define SNIFFER_ACTIVATE_CRC   0x01
 
#define SNIFFER_PDU_CMD   0x20
 
#define SNIFFER_PDU_HEADER_LENGTH   32
 
#define SNIFFER_PDU_VERSION_FORMAT   0x01
 
#define SNIFFER_ROBO_MODULATIONS   0x03
 
#define SNIFFER_SELECT_CHANNEL   0x02
 
#define TIME_HEADER_US   4480L
 
#define TIME_OFDM_SYMBOL_US   2240L
 
#define TIME_PHY_HEADER   ((TIME_HEADER_US / TIME_PHY_UNIT_US) << TIME_SHIFT_BITS)
 
#define TIME_PHY_OFDM_SYMBOL   ((TIME_OFDM_SYMBOL_US / TIME_PHY_UNIT_US) << TIME_SHIFT_BITS)
 
#define TIME_PHY_PREAMBLE   ((TIME_PREAMBLE_US / TIME_PHY_UNIT_US) << TIME_SHIFT_BITS)
 
#define TIME_PHY_UNIT_US   10
 
#define TIME_PREAMBLE_US   2048L
 
#define TIME_SHIFT_BITS   12
 

Functions

static uint16_t _serial_if_sniffer_get_num_symbols (uint16_t us_pdu_len, uint8_t uc_scheme, uint8_t uc_phy_header_type)
 Get the number of symbols in PDU. More...
 
uint8_t serial_if_sniffer_api_parser (uint8_t *puc_rx_msg, uint16_t us_len)
 Received message. More...
 
void serial_if_sniffer_pack_pdu (SnifferParam *px_snif, uint8_t *puc_buf, uint16_t us_len)
 This function packs the received packet. More...
 

Variables

uint8_t cfgSnifferType
 
static uint8_t frameMacToPack [512]