TPppFcs16 Class Reference

class TPppFcs16

Calculates the CCITT CRC-16 used by PPP in HDLC framing.

Public Member Functions
TPppFcs16 ()
void Calc (const TUint8 *, const TUint8 *)
void CalcByte ( TUint8 )
TUint16 Fcs ()
void Init ()
TBool IsGood ()
Private Member Enumerations
enum anonymous { KPppInitFcs16  = 0xffff, KPppGoodFcs16  = 0xf0b8 }
Private Attributes
const TUint16 FcsTable
TUint16 iFcs

Constructor & Destructor Documentation

TPppFcs16()

TPppFcs16 ( ) [inline]

Member Functions Documentation

Calc(const TUint8 *, const TUint8 *)

void Calc ( const TUint8 * aPtr,
const TUint8 * aEnd
)

Calculate a new FCS given the current FCS and the new data.

Parameters

const TUint8 * aPtr
const TUint8 * aEnd

CalcByte(TUint8)

void CalcByte ( TUint8 aByte ) [inline]

Incrementally calculates the CRC for the next message byte.

Parameters

TUint8 aByte Message byte

Fcs()

TUint16 Fcs ( ) const [inline]

Returns the current CRC value.

Init()

void Init ( ) [inline]

Sets the CRC value to the initial state before calculation.

IsGood()

TBool IsGood ( ) const [inline]

Determines if the calculated CRC is valid.

Member Enumerations Documentation

Enum anonymous

Enumerators

KPppInitFcs16 = 0xffff

Initial FCS value

KPppGoodFcs16 = 0xf0b8

Good final FCS value

Member Data Documentation

const TUint16 FcsTable

const TUint16 FcsTable [private, static]

Fast CRC calculation table

TUint16 iFcs

TUint16 iFcs [private]

CRC value