Closed lesamouraipourpre closed 3 years ago
I intend to fix this by making the _parse_int
etc. methods always return either a valid value or None
and never raise a ValueError
.
I also intend to put checks into the _parse_gpgll
etc functions which will fail quickly if the wrong number of comma separated parts has been received.
Would it be possible to fail in the same way as CRC if parse int or float fail? That way you still get an error but you only have one type of error to handle.
I'm aiming to keep it so that the update() method behaviour stays the same, specifically
Returns True if new data was processed, and False if nothing new was received.
Returning False
in the event of an unparseable sentence will match the behaviour of a CRC failure.
Ok, that sounds perfect! Thank you!
Because, the CRC value in the NMEA sentence is only 8-bit, it is fairly easy for a bad message to get past the CRC check. By observation, with my GPS on the window it takes on average ~3 hours before a bad message crashes the program.
This is usually triggered by
_parse_int
and_parse_float
functions and can happen elsewhere.