tarm/goserial — pull request #16 by Joushou (2014-10-28 21:26:15+00:00)
Title: Better handling of Darwin/OS X

I was experiencing some quite severe difficulties with the "posix" handling on my OS X machines. After a while with a constant 115200baud datastream, the stream would stop, and usbd would have issues with 60% idle load.

I had pyserial in my toolbox which I knew worked just fine on the same machine with same speeds and payloads. So, I took serial_linux.go (The implementation was nicer to my eye), and mangled it so it was closer to pyserial's behaviour, both in flags and how to set baudrate on Darwin (Which happens using a special ioctl for IOKit, instead of the legacy posix approach).

I have now successfully run with a constant payload over several hours without it pausing randomly, while it would usually pause after 5 minutes before. It's not very scientific, but it works, and it's prettier than before. serial_posix.go is maintained for other platforms, but the platform-specific handling should probably be unified at some point, as it boils down to flag availability (Do we have an easy way to detect this?), and baudrate method/availability.