ChannelFrameBaseTCalculateChecksum Method

Calculates checksum of given buffer.

Definition

Namespace: Gemstone.PhasorProtocols
Assembly: Gemstone.PhasorProtocols (in Gemstone.PhasorProtocols.dll) Version: 1.0.183 -- Release Build+673491a1afa103b255aa8db4f2bc6d4e220a63e0
protected abstract ushort CalculateChecksum(
	byte[] buffer,
	int offset,
	int length
)

Parameters

buffer  Byte
Buffer image over which to calculate checksum.
offset  Int32
Start index into buffer to calculate checksum.
length  Int32
Length of data within buffer to calculate checksum.

Return Value

UInt16
Checksum over specified portion of buffer.

Remarks

Override with needed checksum calculation for particular protocol.

Example

This example provides a CRC-CCITT checksum: using GSF.IO.Checksums; protected override ushort CalculateChecksum(byte[] buffer, int offset, int length) { // Return calculated CRC-CCITT over given buffer... return buffer.CrcCCITTChecksum(offset, length); }

See Also