TPppFcs16 Class Reference

class TPppFcs16

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

Public Member Functions
TPppFcs16()
voidCalc(const TUint8 *, const TUint8 *)
voidCalcByte(TUint8)
TUint16 Fcs()
voidInit()
TBool IsGood()
Private Member Enumerations
enumanonymous { KPppInitFcs16 = 0xffff, KPppGoodFcs16 = 0xf0b8 }
Private Attributes
const TUint16FcsTable
TUint16 iFcs

Constructor & Destructor Documentation

TPppFcs16()

TPppFcs16()[inline]

Member Functions Documentation

Calc(const TUint8 *, const TUint8 *)

voidCalc(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)

voidCalcByte(TUint8aByte)[inline]

Incrementally calculates the CRC for the next message byte.

Parameters

TUint8 aByteMessage byte

Fcs()

TUint16 Fcs()const [inline]

Returns the current CRC value.

Init()

voidInit()[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 TUint16FcsTable[private, static]

Fast CRC calculation table

TUint16 iFcs

TUint16 iFcs[private]

CRC value