Glinnes / NMEAParser

A simple and compact NMEA parser for Arduino
Other
14 stars 7 forks source link

Non-Standard Token Lengths #6

Open pjensen-addco opened 3 years ago

pjensen-addco commented 3 years ago

Came across the need to parse non-standard NMEA token lengths (thank you ST, for making non-standard NMEA tokens). I updated your code to include a parameter to allow longer than usual tokens.

Only potential problem comes in the strnwcmp function. To allow for varying lengths, I added a break condition. If either string reports a null character (end of string), the function now assumes the strings are equivalent. This could be removed if the code which calls strnwcmp calculated the token length, instead of just defaulting to maximum length, but for this limited application, this workaround works well.

pjensen-addco commented 3 years ago

This is what I get for refactoring something before compiling... Need to add another commit to fix a scope issue.

pjensen-addco commented 3 years ago

Alright, that should fix the problem.