This module provides configuration and utils for the serialization of the embedded sniffer in PRIME.
#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 | ) |
|
#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_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 |
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_msg | Pointer to the data attached to the connection request |
us_len | Data length of the data attached to the request |
- Return values
-
true | primitive stored |
false | primitive 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.
void serial_if_sniffer_pack_pdu |
( |
SnifferParam * |
px_snif, |
|
|
uint8_t * |
puc_buf, |
|
|
uint16_t |
us_len |
|
) |
| |
This function packs the received packet.
- Parameters
-
px_snif | Pointer to sniffer data parameters |
puc_buf | Pointer to the data |
us_len | Data length of the data |
References _pack_ul, _pack_us, _serial_if_sniffer_get_num_symbols(), cfgSnifferType, MASK_SNIFFER_EMBEDDED, pal_get_cfg_ex(), PAL_ID_EX_SNR, PAL_ID_RX_BUFFER_ID, PAL_ID_RX_PAYLOAD_LEN, PAL_ID_RX_RSSI_AVG_RX0, PAL_ID_RX_SCHEME, PAL_ID_TXRX_CHANNEL, PAL_QT_UNKNOW, pal_snr_get(), pal_timer_get(), PROTOCOL_SNIF_PRIME, x_usi_serial_cmd_params_t::ptr_buf, SnifferParam::scheme, SNIFFER_PDU_CMD, SNIFFER_PDU_HEADER_LENGTH, SNIFFER_PDU_VERSION_FORMAT, SNIFFER_RX, SNIFFER_TX, SnifferParam::time, TIME_PHY_HEADER, TIME_PHY_OFDM_SYMBOL, TIME_PHY_PREAMBLE, TIME_SHIFT_BITS, SnifferParam::type, x_usi_serial_cmd_params_t::uc_protocol_type, x_usi_serial_cmd_params_t::us_len, and usi_send_cmd().
uint8_t frameMacToPack[512] |
|
static |