Closed aldas closed 2 years ago
Also btw, you don't need to make that err a pointer in your example:
s, err := nmea.Parse(sentence)
if err != nil {
var nserr nmea.NotSupportedError
if errors.As(err, &nserr) {
log.Println(err)
continue
}
return err
}
Add specific error type (NotSupportedError) when parsing not supported sentence so it would be easier to distinguish these kinds of cases from other parse errors (crc etc).
Example :
For example I am testing stuff atm with Ublox GPS and it sends
$GNTXT,01,01,02,FWVER=TIM 1.10*50
messages which trigger errors. I would like to have easy way to skip these lines (maybe log differently) but I am still interested in other parse problems - ala CRC errors.I also modified one of the examples in README to show type switch syntax which is handy when you need specific code block of different sentence types.