Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Standard Token Lengths #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pjensen-addco
Copy link

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 and others added 3 commits October 21, 2021 10:46
Added two defines:
MAX_TOK_SIZE: Allows for Non-standard NMEA Token Sizes, such as PSTM tokens.
MAX_SENT_SIZE: Allows for Non-standard NMEA Sentence Lengths, for higher precision GPS modules.
@pjensen-addco
Copy link
Author

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

Forgot to compile this repo on the minor refactor.  Now it actually compiles!
@pjensen-addco
Copy link
Author

Alright, that should fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant