bugst / go-serial

A cross-platform serial library for go-lang.
BSD 3-Clause "New" or "Revised" License
681 stars 205 forks source link

serial_unix.go: Keep writing until complete #192

Open ccollins476ad opened 4 months ago

ccollins476ad commented 4 months ago

Fixes #191.

Change unix port.Write() implementation to match io.Writer requirement:

Write must return a non-nil error if it returns n < len(p)

Keep executing write syscall until failure or entire buffer is written.

richyo-work commented 2 months ago

I seem to be experiencing this same issue on a specific piece of hardware / uart. Write reports 5 bytes, and only wrote 2 bytes. Obviously this is very frustrating and should be fixed. I will test this PR