Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98c0c22041 | ||
|
|
486e055d55 | ||
|
|
a117badd4d | ||
|
|
6f4cd1c41b | ||
|
|
10a4a02794 | ||
|
|
ed11af0270 | ||
|
|
67b8715f2f | ||
|
|
c19da5b839 |
2 changed files with 7 additions and 7 deletions
|
|
@ -7,7 +7,7 @@ Introduction
|
|||
:alt: Documentation Status
|
||||
|
||||
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
||||
:target: https://discord.gg/nBQh6qu
|
||||
:target: https://adafru.it/discord
|
||||
:alt: Discord
|
||||
|
||||
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_GPS/workflows/Build%20CI/badge.svg
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class GPS:
|
|||
# return sentence
|
||||
if data_type in (
|
||||
b"GPGLL",
|
||||
b"GNGGL",
|
||||
b"GNGLL",
|
||||
): # GLL, Geographic Position – Latitude/Longitude
|
||||
self._parse_gpgll(args)
|
||||
elif data_type in (b"GPRMC", b"GNRMC"): # RMC, minimum location info
|
||||
|
|
@ -260,7 +260,7 @@ class GPS:
|
|||
|
||||
def _parse_gpgll(self, args):
|
||||
data = args.split(",")
|
||||
if data is None or data[0] is None:
|
||||
if data is None or data[0] is None or (data[0] == ""):
|
||||
return # Unexpected number of params.
|
||||
|
||||
# Parse latitude and longitude.
|
||||
|
|
@ -295,7 +295,7 @@ class GPS:
|
|||
# Parse the arguments (everything after data type) for NMEA GPRMC
|
||||
# minimum location fix sentence.
|
||||
data = args.split(",")
|
||||
if data is None or len(data) < 11 or data[0] is None:
|
||||
if data is None or len(data) < 11 or data[0] is None or (data[0] == ""):
|
||||
return # Unexpected number of params.
|
||||
# Parse fix time.
|
||||
time_utc = int(_parse_float(data[0]))
|
||||
|
|
@ -374,7 +374,7 @@ class GPS:
|
|||
# Parse the arguments (everything after data type) for NMEA GPGGA
|
||||
# 3D location fix sentence.
|
||||
data = args.split(",")
|
||||
if data is None or len(data) != 14:
|
||||
if data is None or len(data) != 14 or (data[0] == ""):
|
||||
return # Unexpected number of params.
|
||||
# Parse fix time.
|
||||
time_utc = int(_parse_float(data[0]))
|
||||
|
|
@ -421,7 +421,7 @@ class GPS:
|
|||
|
||||
def _parse_gpgsa(self, args):
|
||||
data = args.split(",")
|
||||
if data is None:
|
||||
if data is None or (data[0] == ""):
|
||||
return # Unexpected number of params
|
||||
|
||||
# Parse selection mode
|
||||
|
|
@ -444,7 +444,7 @@ class GPS:
|
|||
# Parse the arguments (everything after data type) for NMEA GPGGA
|
||||
# 3D location fix sentence.
|
||||
data = args.split(",")
|
||||
if data is None:
|
||||
if data is None or (data[0] == ""):
|
||||
return # Unexpected number of params.
|
||||
|
||||
# Parse number of messages
|
||||
|
|
|
|||
Loading…
Reference in a new issue