|
ChannelFrameBaseTCalculateChecksum Method
|
Calculates checksum of given buffer.
Namespace: GSF.PhasorProtocolsAssembly: GSF.PhasorProtocols (in GSF.PhasorProtocols.dll) Version: 2.4.205-beta
Syntax protected abstract ushort CalculateChecksum(
byte[] buffer,
int offset,
int length
)
abstract CalculateChecksum :
buffer : byte[] *
offset : int *
length : int -> uint16
function CalculateChecksum(buffer, offset, length);
View SourceParameters
- 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
UInt16Checksum 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 buffer.CrcCCITTChecksum(offset, length);
}
See Also