Imt.Base C++ API V4.1.1.0
Loading...
Searching...
No Matches
imt::base::lib::remoting::DataFrameCRC16CheckReceiveLayer Class Referencefinal

This layer checks incoming data frames for crc errors. More...

#include <Imt.Base.Lib.Remoting/inc/Imt.Base.Lib.Remoting/DataFrameCRC16CheckReceiveLayer.h>

Inheritance diagram for imt::base::lib::remoting::DataFrameCRC16CheckReceiveLayer:
imt::base::lib::remoting::DataReceiverIfc imt::base::core::platform::Nonmovable

Public Member Functions

 DataFrameCRC16CheckReceiveLayer (DataReceiverIfc &upperLevelReceiver, CRC16CheckFailedCallbackIfc &crc16CheckFailedCallback)
 Constructor.
 
void onDataReceived (uint8_t const *const pData, uint32_t const countDataBytes) final
 
void setInitialCrcValue (uint16_t const initialCrcValue)
 Set the initial CRC value to increase robustness of CRC-16 checksum.
 
virtual void onDataReceived (uint8_t const *const pData, uint32_t const countDataBytes)=0
 Callback if data is received.
 

Additional Inherited Members

- Protected Member Functions inherited from imt::base::lib::remoting::DataReceiverIfc
 DataReceiverIfc () noexcept=default
 Default constructor.
 
 ~DataReceiverIfc () noexcept=default
 Destructor.
 
 DataReceiverIfc (DataReceiverIfc const &)=delete
 
 DataReceiverIfc (DataReceiverIfc &&)=delete
 
DataReceiverIfcoperator= (DataReceiverIfc const &) &=delete
 
DataReceiverIfcoperator= (DataReceiverIfc &&) &=delete
 

Detailed Description

This layer checks incoming data frames for crc errors.

Definition at line 22 of file DataFrameCRC16CheckReceiveLayer.h.

Constructor & Destructor Documentation

◆ DataFrameCRC16CheckReceiveLayer()

imt::base::lib::remoting::DataFrameCRC16CheckReceiveLayer::DataFrameCRC16CheckReceiveLayer ( DataReceiverIfc upperLevelReceiver,
CRC16CheckFailedCallbackIfc crc16CheckFailedCallback 
)

Constructor.

Parameters
upperLevelReceiverInterface to the next higher receiver layer.
crc16CheckFailedCallbackCallback if CRC check is failed.

Member Function Documentation

◆ onDataReceived()

void imt::base::lib::remoting::DataFrameCRC16CheckReceiveLayer::onDataReceived ( uint8_t const *const  pData,
uint32_t const  countDataBytes 
)
finalvirtual

◆ setInitialCrcValue()

void imt::base::lib::remoting::DataFrameCRC16CheckReceiveLayer::setInitialCrcValue ( uint16_t const  initialCrcValue)

Set the initial CRC value to increase robustness of CRC-16 checksum.

Older implementations used a default value of 0, which is the least robust. Recommendation: use 0xFFFF as initial value.

Parameters
initialCrcValueInitial value for the CRC-16 checksum calculation.

The documentation for this class was generated from the following file: