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:

pReceivedDataPointer 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
timeReception time (start of message) referred to 1us PHY counter
evmHeaderAcumAccumulated Error Vector Magnitude for header
evmPayloadAcumAccumulated Error Vector Magnitude for payload
evmHeaderError Vector Magnitude for header
evmPayloadError Vector Magnitude for payload
dataLengthLength of the data buffer in bytes
scheme

Modulation scheme of the received message

frameTypeType A, Type B or Type BC frames
headerTypeHeader Type of the received message
rssiAvgAverage RSSI (Received Signal Strength Indication)
cinrAvgAverage CNIR (Carrier to Interference + Noise ratio)
cinrMinMinimum CNIR (Carrier to Interference + Noise ratio)
berSoftAvgAverage Soft BER (Bit Error Rate)
narBandPercentPercentage of carriers affected by narrow band noise
impNoisePercentPercentage of symbols affected by impulsive noise
Related symbolic constants affecting headerType parameter:
headerTypeDescription
PHY_HT_GENERICGeneric PDU are used for all data traffic and most control traffic
PHY_HT_PROMOTIONPromotion Needed PDU sent by disconnected nodes
PHY_HT_BEACONBeacon PDU sent by switch devices