adafruit / Adafruit_CircuitPython_GPS

GPS parsing module for CircuitPython. Meant to parse NMEA data from serial GPS modules.
MIT License
75 stars 60 forks source link

The shortest NMEA sentence can be less than 32 #56

Closed lesamouraipourpre closed 3 years ago

lesamouraipourpre commented 3 years ago

Currently in _read_sentence() the code waits for at least 32 bytes before processing

def _read_sentence(self):
    # Only continue if we have at least 32 bytes in the input buffer
    if self.in_waiting < 32:
        return None

The shortest sentence I can find referenced in a datasheet is 15 bytes long: $PMTK501,2*28<CR><LF>

I can find no definitive shortest sentence, but theoretically, there could be a sentence 11 bytes long: $XXXXX*ZZ<CR><LF> where the talker/sentence_type or proprietary_message is the message and needs no extra data.

ladyada commented 3 years ago

sure if ya like you can submit a PR to shorten it to 11 bytes, not that it isnt a 'minimum sentence' length thing, since usually multiple sentences get emitted at once.

jposada202020 commented 3 years ago

@lesamouraipourpre now that changes were, was this fixed? let me know thanks :)