Skip to content

Commit f95ca0d

Browse files
authored
Merge pull request #62 from lesamouraipourpre/minimum_sentence_size
Change the minimum sentence length to 11
2 parents 81efc56 + 2b98d77 commit f95ca0d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

adafruit_gps.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
2+
# SPDX-FileCopyrightText: 2021 James Carr
23
#
34
# SPDX-License-Identifier: MIT
45

@@ -344,8 +345,8 @@ def _read_sentence(self):
344345
# pylint: disable=len-as-condition
345346
# This needs to be refactored when it can be tested.
346347

347-
# Only continue if we have at least 32 bytes in the input buffer
348-
if self.in_waiting < 32:
348+
# Only continue if we have at least 11 bytes in the input buffer
349+
if self.in_waiting < 11:
349350
return None
350351

351352
sentence = self.readline()
@@ -679,9 +680,9 @@ def write(self, bytestr):
679680

680681
@property
681682
def in_waiting(self):
682-
"""Returns number of bytes available in UART read buffer, always 32
683+
"""Returns number of bytes available in UART read buffer, always 16
683684
since I2C does not have the ability to know how much data is available"""
684-
return 32
685+
return 16
685686

686687
def readline(self):
687688
"""Returns a newline terminated bytearray, must have timeout set for

0 commit comments

Comments
 (0)