bugst / go-serial

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

add support for drain #83

Closed polomsky closed 11 months ago

polomsky commented 4 years ago

Tested on Mac OS, Linux and Windows with UART emulated on USB.

I wrote general BSD code, because it should work, but I am not able to test it.

On Mac OS I am quite sure that drain behaves as needed. For Windows it seems that drain is actually part of Write, because Write was slow and Drain was fast. But I have not found any mention in Win32 docs about buffering and asynchronous write, so I kept it. For Linux Drain is also taking more time than writing.

wissamalkja commented 4 years ago

great ,,

smuroff commented 3 years ago

@wissamalkja could you merge it? I've looked for the same feature.

cmaglie commented 11 months ago

The Linux implementation has been replaced with #159.