dotMorten / NmeaParser

Library for handling NMEA message in Windows Desktop, Store, Phone, Universal, and Xamarin (Android + iOS), coming from files, bluetooth, serial port or any stream
https://dotmorten.github.io/NmeaParser/
Apache License 2.0
262 stars 89 forks source link

Update GPGGA parsing to handle non-values for integer options #15

Closed kevin-whalley-gc closed 5 years ago

kevin-whalley-gc commented 9 years ago

Modified GPGGA parsing so Quality and Number of Satellites can be set to default values if not parseable (e.g. empty)

I considered making a StringToInt helper method as you've done with StringToDouble but decided this was less impact

dotMorten commented 8 years ago

I think this is a good fix. Do you mind adding a quick little unit test for an invalid message like this as well?

Btw sorry for missing this PR and taking me so long to get back to you.

dotMorten commented 5 years ago

Looking over this again, I think the parsing should fail here, since the message is invalid, rather than using TryParse and then "lying" about the quality..