openPDC Synchrophasor Help
CalculateChecksum Method (buffer, offset, length)
NamespacesTVA.PhasorProtocolsChannelFrameBase<(Of <(<'T>)>)>CalculateChecksum(array<Byte>[]()[][], Int32, Int32)
Calculates checksum of given buffer.
Declaration Syntax
C#Visual BasicVisual C++
protected abstract ushort CalculateChecksum(
	byte[] buffer,
	int offset,
	int length
)
Protected MustOverride Function CalculateChecksum ( _
	buffer As Byte(), _
	offset As Integer, _
	length As Integer _
) As UShort
protected:
virtual unsigned short CalculateChecksum(
	array<unsigned char>^ buffer, 
	int offset, 
	int length
) abstract
Parameters
buffer (array<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
Checksum over specified portion of buffer.
Remarks
Override with needed checksum calculation for particular protocol.
Examples
This example provides a CRC-CCITT checksum:
CopyC#
using TVA.IO.Checksums;

protected override ushort CalculateChecksum(byte[] buffer, int offset, int length)
{
    // Return calculated CRC-CCITT over given buffer...
    return buffer.CrcCCITTChecksum(offset, length);
}

Assembly: TVA.PhasorProtocols (Module: TVA.PhasorProtocols) Version: 1.4.192.0