adafruit / Adafruit_CircuitPython_GPS

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

Question about reading from gps. #111

Closed dinapappor closed 2 months ago

dinapappor commented 2 months ago

I know this isn't a python question, but more specifically about the gps module it self.

Python code works great. But I wanted to see if I could implement something in golang.

In python we read one byte at a time in the adafruit_gps code. Why is that done like that?

In golang I can read until newline but that leaves me from getting anything from the gps circuit for eons of time. I suspect it's related to why python implementation is reading one byte at a time.

Is this a limitaiton of the gps module? Am I "killing(?)" the buffer when reading until newline instead of doing it one byte at a time?

dinapappor commented 2 months ago

This issue can be closed. This was nothing but :derp: on my side. I tried to use bufio.Reader.Read() for this, once switching to os.File.Read() it started working as expected.