jacobsa / go-serial

A Go library for dealing with serial ports.
Apache License 2.0
626 stars 120 forks source link

Feature Request: Send BREAK Signal #30

Closed SMerrony closed 2 years ago

SMerrony commented 6 years ago

I am using this package in an open source project https://github.com/SMerrony/DasherG to access legacy hardware and it works just fine with one exception: I can't see any way to send a serial BREAK signal.

Have I overlooked something, or could this feature be added?

mchaka commented 5 years ago

If you can afford a little latency you can switch to slower pace and send a zero value frame with that speed (will yield 9 zeros). Then switch back to your normal communication speed. Switch from speed to speed may cost a lot of time. For example I'm targetting around 100us break with 250k data baud rate which means the bit duration must be 100us / 9bits > 11.111us/bit so the baud rate must be dropped below 90k temporarily to achieve that.