ChannelFrameBaseTCalculateChecksum Method
Calculates checksum of given buffer.
Namespace: Gemstone.PhasorProtocolsAssembly: Gemstone.PhasorProtocols (in Gemstone.PhasorProtocols.dll) Version: 1.0.128 -- Release Build+dd7f32701ba80de4d5b0557e84e0ddc18a34573f
protected abstract ushort CalculateChecksum(
byte[] buffer,
int offset,
int length
)
function CalculateChecksum(buffer, offset, length);
- 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.
UInt16Checksum over specified portion of
buffer.
Override with needed checksum calculation for particular protocol.
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);
}