checksum_NMEA( input_str, result );
||The NUL terminated input string for which the NMEA checksum must be calculated|
||Storage buffer to the calculated NMEA checksum|
||Pointer to the storage buffer with the NMEA checksum result|
checksum_NMEA() calculates the checksum in NMEA messages. The NMEA protocol is mainly used in marine equipment. The string may optionally be starting with a
$ character. This character is automatically ignored by the checksum calculation algorithm. The end of the NMEA is reached when the algorithm detects the end of the NUL terminated string, a newline character or a
The function returns the checksum as a NUL terminated string with two hexadecimal characters stored in a caller provided buffer. For this reason the calling function must provide a buffer which can at least contain 3 bytes. If NULL is provided as either the pointer to the input string or the pointer to the result buffer the function returns NULL. Otherwise the return value is a pointer to the beginning of the result string.