Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PRIME Serial Embedded Sniffer

This module provides configuration and utils for the serialization of the embedded sniffer in PRIME.

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]
 

#define _pack_ul (   ul_data)
Value:
{ \
*puc_tx++ = (uint8_t)(ul_data >> 24); \
*puc_tx++ = (uint8_t)(ul_data >> 16); \
*puc_tx++ = (uint8_t)(ul_data >> 8); \
*puc_tx++ = (uint8_t)ul_data; \
}

Referenced by serial_if_sniffer_pack_pdu().

#define _pack_us (   us_data)
Value:
{ \
*puc_tx++ = (uint8_t)(us_data >> 8); \
*puc_tx++ = (uint8_t)us_data; \
}

Referenced by serial_if_sniffer_pack_pdu().

#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

static uint16_t _serial_if_sniffer_get_num_symbols ( uint16_t  us_pdu_len,
uint8_t  uc_scheme,
uint8_t  uc_phy_header_type 
)
static

Get the number of symbols in PDU.

Parameters
us_pdu_lenPDU length
uc_schemeScheme
uc_phy_header_typePHY header type
Return values
numberof symbols in PDU

References MAC_HEADER_SIZE, and PHY_HT_PROMOTION.

Referenced by serial_if_sniffer_pack_pdu().

uint8_t serial_if_sniffer_api_parser ( uint8_t *  puc_rx_msg,
uint16_t  us_len 
)

Received message.

Note
Process Dialogue with peer
  • Proces Profiles
  • Wait for received message
  • Process incoming message
  • Send response if necessary
Parameters
puc_rx_msgPointer to the data attached to the connection request
us_lenData length of the data attached to the request
Return values
trueprimitive stored
falseprimitive could not be stored

References PHY_ID_CFG_TXRX_CHANNEL, phy_mac_crc_disable(), phy_mac_crc_enable(), phy_set_cfg_param(), puc_rx, SNIFFER_ACTIVATE_CRC, SNIFFER_ATPL210, SNIFFER_ATPL240, SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST, SNIFFER_IF_PHY_COMMAND_MAC_CRC, SNIFFER_IF_PHY_COMMAND_MESSAGE, SNIFFER_IF_PHY_COMMAND_SET_CHANNEL, and SNIFFER_SELECT_CHANNEL.

uint8_t cfgSnifferType
uint8_t frameMacToPack[512]
static