1.1.4 Reception
When a PLC message is received, it is processed in the callback function
APP_PLC_DataIndCb(). This function receives a structure of type
DRV_PLC_PHY_RECEPTION_OBJ as a parameter containing all the
available data from the message.
The callback function checks if CRC validation was OK, extracts some data about the modulation and signal received. The function checks the length of the message and sends the content and information about the signal quality to the host console.
Structure DRV_PLC_PHY_RECEPTION_OBJ
// *****************************************************************************
/* PRIME Reception parameters
Summary
This struct includes all information to describe any new received message.
Remarks:
None
*/
typedef struct __attribute__((packed, aligned(1))) {
/* Pointer to received data buffer */
uint8_t *pReceivedData;
/* Instant when frame was received (start of message) referred to 1us PHY counter */
uint32_t time;
/* Accumulated Error Vector Magnitude for header */
uint32_t evmHeaderAcum;
/* Accumulated Error Vector Magnitude for payload */
uint32_t evmPayloadAcum;
/* Error Vector Magnitude for header */
uint16_t evmHeader;
/* Error Vector Magnitude for payload */
uint16_t evmPayload;
/* Length of the received data in bytes */
uint16_t dataLength;
/* Scheme of Modulation */
DRV_PLC_PHY_SCH scheme;
/* PRIME Frame type */
DRV_PLC_PHY_FRAME_TYPE frameType;
/* Header type */
DRV_PLC_PHY_HEADER headerType;
/* Average RSSI (Received Signal Strength Indication) in dBuV */
uint8_t rssiAvg;
/* Average CNIR (Carrier to Interference + Noise ratio) */
uint8_t cinrAvg;
/* Minimum CNIR (Carrier to Interference + Noise ratio) */
uint8_t cinrMin;
/* Average Soft BER (Bit Error Rate) */
uint8_t berSoftAvg;
/* Maximum Soft BER (Bit Error Rate) */
uint8_t berSoftMax;
/* Percentage of carriers affected by narrow band noise */
uint8_t narBandPercent;
/* Percentage of symbols affected by impulsive noise */
uint8_t impNoisePercent;
} DRV_PLC_PHY_RECEPTION_OBJ;
The structure contains all the information available about the message received. The fields of the structure are:
pReceivedData | Pointer to data buffer containing received frame. The received frame includes padding (if needed). CRC is included if the CRC capability in the PL360 is disabled |
time | Reception time (start of message) referred to 1us PHY counter |
evmHeaderAcum | Accumulated Error Vector Magnitude for header |
evmPayloadAcum | Accumulated Error Vector Magnitude for payload |
evmHeader | Error Vector Magnitude for header |
evmPayload | Error Vector Magnitude for payload |
dataLength | Length of the data buffer in bytes |
scheme |
Modulation scheme of the received message |
frameType | Type A, Type B or Type BC frames |
headerType | Header Type of the received message |
rssiAvg | Average RSSI (Received Signal Strength Indication) |
cinrAvg | Average CNIR (Carrier to Interference + Noise ratio) |
cinrMin | Minimum CNIR (Carrier to Interference + Noise ratio) |
berSoftAvg | Average Soft BER (Bit Error Rate) |
narBandPercent | Percentage of carriers affected by narrow band noise |
impNoisePercent | Percentage of symbols affected by impulsive noise |
Related symbolic constants affecting
headerType parameter:| headerType | Description |
|---|---|
| PHY_HT_GENERIC | Generic PDU are used for all data traffic and most control traffic |
| PHY_HT_PROMOTION | Promotion Needed PDU sent by disconnected nodes |
| PHY_HT_BEACON | Beacon PDU sent by switch devices |
