Пример #1
0
        protected virtual bool CheckCRC(byte[] data)
        {
            var crcH = data[data.Length - 2];
            var crcL = data[data.Length - 1];

            var buffer = new byte[data.Length - 2];

            Buffer.BlockCopy(data, 0, buffer, 0, buffer.Length);
            var crc = CRCCalculator.ChecksumToArray(buffer);

            return((crcL == crc[1]) && (crcH == crc[0]));
        }
Пример #2
0
 protected virtual byte[] OnComputeCRC(byte[] data)
 {
     return(CRCCalculator.ChecksumToArray(data));
 }