
You also have to keep track of whether there were newlines, if this is important to you. This means you have to keep track of how much data was read. It returns the number of bytes read and any error encountered. Read reads up to len(b) bytes from the File.

The documentation for this function call is: When you Read() from this, the library calls Read() on the underlying os.File. The struct you get back from serial.OpenPort() contains a pointer to an open os.File corresponding to the opened serial port connection. This is how the stream is outputted: $GLGSV,3 Looking back, I think the issue is that I'm getting a stream and I want to be able to iterate over lines of the stty, rather than chunks.
#Goserial example how to
I suspect that this is due to the buffer size or the value of Size in the config struct being wrong, but I'm not sure how to get those values from the stty settings.

Currently, I have package mainīut this prints malformed data.

I can read from shell using stty -F /dev/ttyAMA cs8 clocal -cstopb I'm trying to read from a serial port (a GPS device on a Raspberry Pi).
