Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Pre-commit check done.
  • Loading branch information
PierreDeQuebec committed Dec 30, 2022
commit 0b82035b5a6bbbed6fda5c2c477c2672d4a7c3c2
8 changes: 5 additions & 3 deletions adafruit_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def update(self) -> bool:
# It's not a known GNSS source of data
# Assume it's a valid packet anyway
# False: PGTOP. Status of antenna extension.
return True if data_type[:5] != b"PGTOP" else self._parse_pgtop(args)
return True if not data_type.endswith(b"PGTOP") else self._parse_pgtop(args)

result = True
args = args.split(",")
Expand Down Expand Up @@ -685,11 +685,13 @@ def _parse_pgtop(self, data) -> int:
return False

# Antenna status. 1: Antenna shorted. 2: Internal antenna. 3: Active (extension) antenna.
# User can detect change in antenna status by testing equality between item 0 and item 1 of tuple.
# User is responsible to acknowledge change in the antenna status by making self.antenna[1] same as item 0.
# User can detect change in antenna status by testing equality between item 0 and item 1 of
# tuple. User is responsible to acknowledge change in the antenna status by making
# self.antenna[1] same as item 0.
self.antenna = (data[3], self.antenna[1])
return True


class GPS_GtopI2C(GPS):
"""GTop-compatible I2C GPS parsing module. Can parse simple NMEA data
sentences from an I2C-capable GPS module to read latitude, longitude, and more.
Expand Down