openthread-br  0.3.0-72c0388
Public Types | Public Member Functions | List of all members
otbr::Crc16 Class Reference

#include <src/utils/crc16.hpp>

Public Types

enum  Polynomial { kCcitt = 0x1021, kAnsi = 0x8005 }
 

Public Member Functions

 Crc16 (Polynomial aPolynomial)
 
void Init (void)
 
void Update (uint8_t aByte)
 
uint16_t Get (void) const
 

Detailed Description

This class implements CRC16 computations.

Member Enumeration Documentation

◆ Polynomial

Enumerator
kCcitt 

CRC16_CCITT.

kAnsi 

CRC16-ANSI.

Constructor & Destructor Documentation

◆ Crc16()

otbr::Crc16::Crc16 ( Polynomial  aPolynomial)

This constructor initializes the object.

Parameters
[in]aPolynomialThe polynomial value.

Member Function Documentation

◆ Get()

uint16_t otbr::Crc16::Get ( void  ) const
inline

This method gets the current CRC16 value.

Returns
The current CRC16 value.

◆ Init()

void otbr::Crc16::Init ( void  )
inline

This method initializes the CRC16 computation.

◆ Update()

void otbr::Crc16::Update ( uint8_t  aByte)

This method feeds a byte value into the CRC16 computation.

Parameters
[in]aByteThe byte value.

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