// TODO: Write about this. /home/leo/external/projects/ublox-gps/test.py
The device is initially in NMEA mode, so all the messages it reads and writes are in the NMEA format. The checksum for this format is simple.
def nmea_checksum(line):
checksum = 0
for c in line:
checksum ^= c
return hex(checksum)[2:].zfill(2).upper().encode("ascii")