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 generic xxRMC and xxGGA terms #9

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/TinyGPS++.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define _GPGSVterm "GPGSV"
#define _GPRMCterm "GPRMC"
#define _GPGGAterm "GPGGA"
#define _GNRMCterm "GNRMC"
#define _GNGGAterm "GNGGA"
#define _GARMCterm "GARMC"
#define _GAGGAterm "GAGGA"
#define _GLRMCterm "GLRMC"
#define _GLGGAterm "GLGGA"

TinyGPSPlus::TinyGPSPlus()
: parity(0)
Expand Down Expand Up @@ -302,11 +296,12 @@ bool TinyGPSPlus::endOfTermHandler(bool termIsNotEmpty)
}

// the first term determines the sentence type
// xxRMC/xxGGA where xx = NMEA Talker ID (GP=GPS, GL=GLONASS, GA=Galileo, GB/BD=Beidou, GN=GNSS)
if (curTermNumber == 0)
{
if (!strcmp(term, _GPRMCterm) || !strcmp(term, _GNRMCterm) || !strcmp(term, _GARMCterm) || !strcmp(term, _GLRMCterm))
if (strlen(term) == 5 && !strncmp(term+2, "RMC", 3))
curSentenceType = GPS_SENTENCE_GPRMC;
else if (!strcmp(term, _GPGGAterm) || !strcmp(term, _GNGGAterm) || !strcmp(term, _GAGGAterm) || !strcmp(term, _GLRMCterm))
else if (strlen(term) == 5 && !strncmp(term+2, "GGA", 3))
curSentenceType = GPS_SENTENCE_GPGGA;
else if (!strcmp(term, _GPGSVterm))
curSentenceType = GPS_SENTENCE_GPGSV;
Expand Down