Computes nme checksum for the given NMEA string
The computed checksum
The checksum for an NMEA string is computed as an XOR value for all bytes between (but not including) the dollar sign and the asterisk character, according to http://www.codepedia.com/1/Taking+Out+the+Garbage:+NMEA+Checksums This method computes the checksum from the first dollar character and the first asterisk after it or up to the end of the array, if asterisk has not been found. If the array has at least two bytes more after the asterisk, the the checksum is additionally put hexadecimally in there. Exammple, for the followig byte array
$PSRF103,00,01,00,01*xx\r\nthe method computes checksum 37 (hex 25) and puts it into the two bytes xx after the asterisk character. The resulting byte array will be then:
$PSRF103,00,01,00,01*25\r\n
Utils Class | serial Namespace