-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Some time ago I was parsing nmea0183 strings and I noticed that in certain sentences with empty ,, prevented parsing and didn't show values in SK. Sentences were GGA and GLL.
I was wondering if function isEmpty too conservative and removes otherwise valid sentences.
Below is how standard IEC 61162-1 (nmea0183) defines e.g. empty/null.
7.2.3.4 Null fields
A null field is a field of length zero, i.e. no characters are transmitted in the field. Null fields
shall be used when the value is unreliable or not available.
For example, if heading information were not available, sending data of "000" is misleading
because a user cannot distinguish between "000" meaning no data and a legitimate heading of
"000". However, a null field, with no characters at all, clearly indicates that no data is being
transmitted.
Null fields with their delimiters can have the following appearance depending on where they are
located in the sentence:
",," ",*"
The ASCII NULL character (HEX 00) shall not be used as the null field.
Unreliable or not available are valid cases for individual measurements, but now it can cause that whole sentence is not processed.
In DSC, GGA, GLL, HDG, VWR and ZDA sentences there are this kind of isEmpty check.
Could this check be changed following way? accept empty in nmea0183 string
In addition to this, there is another change, which I'd like bundle here. Change would be to nmea0183-utilities.
Couple of functions there are returning 0 instead of null for empty.
Could this check be changed following way? 0 to null
What do you think?