From 2b98d77f63593e22505a51541e9d7c989eac072b Mon Sep 17 00:00:00 2001 From: James Carr Date: Sun, 25 Apr 2021 21:36:09 +0100 Subject: [PATCH] Change the minimum sentence length to 11 (Closes #56) --- adafruit_gps.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/adafruit_gps.py b/adafruit_gps.py index aac7fc2..6341ed1 100644 --- a/adafruit_gps.py +++ b/adafruit_gps.py @@ -1,4 +1,5 @@ # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries +# SPDX-FileCopyrightText: 2021 James Carr # # SPDX-License-Identifier: MIT @@ -344,8 +345,8 @@ def _read_sentence(self): # pylint: disable=len-as-condition # This needs to be refactored when it can be tested. - # Only continue if we have at least 32 bytes in the input buffer - if self.in_waiting < 32: + # Only continue if we have at least 11 bytes in the input buffer + if self.in_waiting < 11: return None sentence = self.readline() @@ -679,9 +680,9 @@ def write(self, bytestr): @property def in_waiting(self): - """Returns number of bytes available in UART read buffer, always 32 + """Returns number of bytes available in UART read buffer, always 16 since I2C does not have the ability to know how much data is available""" - return 32 + return 16 def readline(self): """Returns a newline terminated bytearray, must have timeout set for