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

Support for Beidou & GLONASS #128

Open
JasonPittenger opened this issue Oct 27, 2023 · 0 comments
Open

Support for Beidou & GLONASS #128

JasonPittenger opened this issue Oct 27, 2023 · 0 comments

Comments

@JasonPittenger
Copy link

Can you add support for Beidou & GLONASS?
Instead of a string compare for an exact match, I suggest a string search for the sentence type.
This then is agnostic to the system being used.

Global Positioning System (GPS, SBAS, QZSS) = GP
Global Navigation Satellite System (GNSS) = GN
Global Navigation Satellite System (GLONASS) = GL
Beidou Navigation Satellite System (BDS) = BD

This

#define _GPRMCterm   "GPRMC"
#define _GPGGAterm   "GPGGA"
#define _GNRMCterm   "GNRMC"
#define _GNGGAterm   "GNGGA"

becomes

#define __RMCterm   "RMC"
#define __GGAterm   "GGA"

and

if (!strcmp(term, _GPRMCterm) || !strcmp(term, _GNRMCterm))
      curSentenceType = GPS_SENTENCE_GPRMC;
    else if (!strcmp(term, _GPGGAterm) || !strcmp(term, _GNGGAterm))
      curSentenceType = GPS_SENTENCE_GPGGA;
    else
      curSentenceType = GPS_SENTENCE_OTHER;

Becomes

if (strstr(term, __RMCterm)
      curSentenceType = GPS_SENTENCE_GPRMC;
    else if (strstr(term, __GGAterm))
      curSentenceType = GPS_SENTENCE_GPGGA;
    else
      curSentenceType = GPS_SENTENCE_OTHER;
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

No branches or pull requests

1 participant