I'm not a C# programmer, but I've been asked to add CRC checksum checking to some code that receives a string of data from a remote system via a wireless connection.
The data logging application in C# reads the data in the form of an ASCII string from the remote sensors. The last byte of the data string (immediately before the <CR> that terminates the data) is a binary CRC8 checksum. I need to compute the CRC8 value of the received string up to, but not including, the received CRC8 byte and the <CR> charater.
The problem is is that the CRC8 code that I've been given takes as its parameter a byte array rather than a string. The method definition looks like this:
public byte Checksum(params byte[] val)
How can I convert the string I have to something the Checksum() method can use?
The data logging application in C# reads the data in the form of an ASCII string from the remote sensors. The last byte of the data string (immediately before the <CR> that terminates the data) is a binary CRC8 checksum. I need to compute the CRC8 value of the received string up to, but not including, the received CRC8 byte and the <CR> charater.
The problem is is that the CRC8 code that I've been given takes as its parameter a byte array rather than a string. The method definition looks like this:
public byte Checksum(params byte[] val)
How can I convert the string I have to something the Checksum() method can use?