Skip to content
Open
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
19 changes: 8 additions & 11 deletions micropyGPS.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ def update(self, new_char):
self.clean_sentences += 1 # Increment clean sentences received
self.sentence_active = False # Clear Active Processing Flag

if self.gps_segments[0] in self.supported_sentences:
if self.gps_segments[0][2:] in self.supported_sentences:

# parse the Sentence Based on the message type, return True if parse is clean
if self.supported_sentences[self.gps_segments[0]](self):
if self.supported_sentences[self.gps_segments[0][2:]](self):

# Let host know that the GPS object was updated by returning parsed sentence type
self.parsed_sentences += 1
Expand Down Expand Up @@ -815,15 +815,12 @@ def date_string(self, formatting='s_mdy', century='20'):
return date_string

# All the currently supported NMEA sentences
supported_sentences = {'GPRMC': gprmc, 'GLRMC': gprmc,
'GPGGA': gpgga, 'GLGGA': gpgga,
'GPVTG': gpvtg, 'GLVTG': gpvtg,
'GPGSA': gpgsa, 'GLGSA': gpgsa,
'GPGSV': gpgsv, 'GLGSV': gpgsv,
'GPGLL': gpgll, 'GLGLL': gpgll,
'GNGGA': gpgga, 'GNRMC': gprmc,
'GNVTG': gpvtg, 'GNGLL': gpgll,
'GNGSA': gpgsa,
supported_sentences = {'RMC': gprmc,
'GGA': gpgga,
'VTG': gpvtg,
'GSA': gpgsa,
'GSV': gpgsv,
'GLL': gpgll,
}

if __name__ == "__main__":
Expand Down