protected void dosendCRC() { byte[] tocrc = new byte[6]; Array.Copy(sendbuffer, 0, tocrc, 0, 6); byte[] crcbuf = UtilTools.CRCCalc(tocrc); sendbuffer[6] = crcbuf[0]; sendbuffer[7] = crcbuf[1]; }
public Boolean CheckCRC() { return(UtilTools.DataCRC(ref buffer, buffer.Length)); //int len = buffer.Length; //byte[] tocrc = new byte[buffer.Length - 2]; //Array.Copy(buffer,tocrc, len - 2); //byte[] crc = UtilTools.CRCCalc(tocrc); //if (crc[0] == buffer[len - 2] && crc[1] == buffer[len - 1]) //{ // return true; //} //else //{ // return false; //} }