This module provides configuration and utils for the sniffer in the PLC PHY layer.
Data Structures | |
struct | x_usi_sniffer_cmd_params |
Macros | |
#define | SNIFFER_ATPL230 0x01 |
#define | SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST 3 /* Enable robust modes of PRIME */ |
#define | SNIFFER_IF_PHY_COMMAND_MAC_CRC 1 /* ENABLE MAC on the ATPL230 */ |
#define | SNIFFER_IF_PHY_COMMAND_MESSAGE 4 /* Inject message in PLC */ |
#define | SNIFFER_IF_PHY_COMMAND_SET_CHANNEL 2 /* SET PLC channel (1 = CENELEC- A) */ |
#define | SNIFFER_IF_PHY_MESSAGE_PRIME_1_3 0x20 /* PRIME_1_3 pdu received */ |
#define | SNIFFER_IF_PHY_MESSAGE_PRIME_PLUS 0x21 /* PRIME_PLUS pdu received */ |
#define | SNIFFER_VERSION 0x14 |
#define | TASK_SNIFFER_IF_GET_RX_PRIO (tskIDLE_PRIORITY + 1) |
#define | TASK_SNIFFER_IF_GET_RX_STACK (configMINIMAL_STACK_SIZE * 1) |
#define | TIME_IN_TICS(x) (x / 10) |
#define | TIME_OFDM_SYMBOL_US 2240L |
#define | TIME_PRIME_1_3_HEADER_US 4480L |
#define | TIME_PRIME_1_3_PREAMBLE_US 2048L |
#define | TIME_PRIME_PLUS_HEADER_US (TIME_OFDM_SYMBOL_US * 4) |
#define | TIME_PRIME_PLUS_PREAMBLE_US (TIME_PRIME_1_3_PREAMBLE_US * 4) |
Functions | |
usi_status_t | Dummy_sniffer_send_cmd (void *msg) |
Default serial interface for unused USI. More... | |
uint8_t | serial_if_sniffer_api_parser (uint8_t *puc_rx_msg, uint16_t us_len) |
Received message. More... | |
void | sniffer_if_init (uint8_t uc_enable_led) |
Initialize sniffer interface. More... | |
void | sniffer_if_process (void) |
Task to manage the serialization of the reception message through USI. More... | |
static x_usi_sniffer_cmd_params | x_phy_sniffer_msg |
static uint8_t | uc_sniffer_led_enable |
static uint8_t | uc_sniffer_data_buf [800] |
static uint8_t | uc_sniffer_rsp_buf [800] |
#define SNIFFER_ATPL230 0x01 |
Referenced by sniffer_if_process().
#define SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST 3 /* Enable robust modes of PRIME */ |
Referenced by serial_if_sniffer_api_parser().
#define SNIFFER_IF_PHY_COMMAND_MAC_CRC 1 /* ENABLE MAC on the ATPL230 */ |
Referenced by serial_if_sniffer_api_parser().
#define SNIFFER_IF_PHY_COMMAND_MESSAGE 4 /* Inject message in PLC */ |
Referenced by serial_if_sniffer_api_parser().
#define SNIFFER_IF_PHY_COMMAND_SET_CHANNEL 2 /* SET PLC channel (1 = CENELEC- A) */ |
Referenced by serial_if_sniffer_api_parser().
#define SNIFFER_IF_PHY_MESSAGE_PRIME_1_3 0x20 /* PRIME_1_3 pdu received */ |
Referenced by sniffer_if_process().
#define SNIFFER_IF_PHY_MESSAGE_PRIME_PLUS 0x21 /* PRIME_PLUS pdu received */ |
Referenced by sniffer_if_process().
#define SNIFFER_VERSION 0x14 |
Referenced by sniffer_if_process().
#define TASK_SNIFFER_IF_GET_RX_PRIO (tskIDLE_PRIORITY + 1) |
#define TASK_SNIFFER_IF_GET_RX_STACK (configMINIMAL_STACK_SIZE * 1) |
#define TIME_IN_TICS | ( | x | ) | (x / 10) |
Referenced by sniffer_if_process().
#define TIME_OFDM_SYMBOL_US 2240L |
Referenced by sniffer_if_process().
#define TIME_PRIME_1_3_HEADER_US 4480L |
Referenced by sniffer_if_process().
#define TIME_PRIME_1_3_PREAMBLE_US 2048L |
Referenced by sniffer_if_process().
#define TIME_PRIME_PLUS_HEADER_US (TIME_OFDM_SYMBOL_US * 4) |
Referenced by sniffer_if_process().
#define TIME_PRIME_PLUS_PREAMBLE_US (TIME_PRIME_1_3_PREAMBLE_US * 4) |
Referenced by sniffer_if_process().
usi_status_t Dummy_sniffer_send_cmd | ( | void * | msg | ) |
Default serial interface for unused USI.
References UNUSED, and USI_STATUS_PROTOCOL_NOT_FOUND.
uint8_t serial_if_sniffer_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Received message.
puc_rx_msg | Pointer to the received data |
us_len | Data length of the received data |
true | if there is no error |
false | if length is invalid or sniffer command is wrong |
References PHY_ID_CFG_TXRX_CHANNEL, phy_mac_crc_disable(), phy_mac_crc_enable(), phy_set_cfg_param(), SNIFFER_IF_PHY_COMMAND_ENABLE_PRIME_PLUS_ROBUST, SNIFFER_IF_PHY_COMMAND_MAC_CRC, SNIFFER_IF_PHY_COMMAND_MESSAGE, and SNIFFER_IF_PHY_COMMAND_SET_CHANNEL.
Referenced by _process_msg().
void sniffer_if_init | ( | uint8_t | uc_enable_led | ) |
Initialize sniffer interface.
uc_enable_led | Enable led |
References PHY_ID_RX_QR_MODE_ID, phy_mac_crc_disable(), phy_set_cfg_param(), REG_ATPL230_SNA0, x_usi_sniffer_cmd_params::uc_protocol_type, and UNUSED.
Referenced by phy_reset().
void sniffer_if_process | ( | void | ) |
Task to manage the serialization of the reception message through USI.
References xPhyMsgRx_t::cinr_avg, xPhyMsgRx_t::data_buf, xPhyMsgRx_t::data_len, xPhyMsgRx_t::header_type, LED_Toggle, xPhyMsgRx_t::mode, MODE_TYPE_A, MODE_TYPE_B, MODE_TYPE_BC, phy_get_cfg_param(), phy_get_mac_en(), PHY_ID_CFG_TXRX_CHANNEL, PHY_ID_RX_PAYLOAD_LEN_SYM, phy_rx_frame_cb(), phy_set_cfg_param(), x_usi_sniffer_cmd_params::ptr_buf, REG_ATPL230_SNA0, REG_ATPL230_TXRXBUF_RECTIME1_RX0, xPhyMsgRx_t::rssi_avg, xPhyMsgRx_t::scheme, SNIFFER_ATPL230, SNIFFER_IF_PHY_MESSAGE_PRIME_1_3, SNIFFER_IF_PHY_MESSAGE_PRIME_PLUS, SNIFFER_VERSION, TIME_IN_TICS, TIME_OFDM_SYMBOL_US, TIME_PRIME_1_3_HEADER_US, TIME_PRIME_1_3_PREAMBLE_US, TIME_PRIME_PLUS_HEADER_US, TIME_PRIME_PLUS_PREAMBLE_US, xPhyMsgRx_t::uc_buff_id, uc_sniffer_data_buf, uc_sniffer_rsp_buf, x_usi_sniffer_cmd_params::us_len, and usi_send_cmd().
Referenced by main().
|
static |
Referenced by sniffer_if_process().
|
static |
|
static |
Referenced by sniffer_if_process().
|
static |