Knio / pynmea2

Python library for parsing the NMEA 0183 protocol (GPS)
MIT License
635 stars 223 forks source link

parsed.identifier() returns with and without comma. #130

Closed Shal-Ziar closed 3 years ago

Shal-Ziar commented 3 years ago

Version: Pynmea 1.18.0 When parsing NMEA messages such as: '$PRDID,-1.71,-0.22,89.10*4E\n' the parsed field is returned without ',' -> 'PRDI'

If one however parses an GPRMC message it is returned with comma: '$GPRMC,154933.24,A,5152.9896,N,00413.8888,E,5.390,282.61,100521,1.71,E,D*34\n' parsed.identifier()-> 'GPRMC,'

I think this behaviour should be consistently with or without comma (preferably without).

Knio commented 3 years ago

Unfortunately, this is due to individual device manufacturers themselves being inconsistent and not exactly following the spec. The identifier() behavior is a bit messy and could be potentially changed, but we do need some API that includes or does not include the comma, and that was the best place at the time. We need this to be able to be compatible with these manufacturers, and that is a higher priority to me than following the spec exactly.

Shal-Ziar commented 3 years ago

Ah, very well.. Thanks for the quick response.