distributed / sers

Serial port access for the Go programming language.
MIT License
38 stars 7 forks source link

Set and clear break #4

Closed telemac closed 6 years ago

telemac commented 6 years ago

Hello,

Would it be possible to add a function like this to set and clear break on the serial line ? Thank you very much for sharing your work.

int setbreak(int fd,bool on) {
    if (on) {
        return ioctl(fd, TIOCSBRK, NULL);
    } else {
        return ioctl(fd, TIOCCBRK, NULL);
    }
}
distributed commented 6 years ago

Yes, I would very much appreciate the library having more complete support for typical serial port features.

This weekend I am lacking the equipment to test such a change. Are you set up? Which platforms are you using?

telemac commented 6 years ago

I tested this code on a Raspberry pi with raspbian and it works.

distributed commented 6 years ago

I added a SetBreak(on bool) method to the serial port interface, see #5. It works for me under OS X and Windows, please check to see whether it works on your Raspberry with Raspbian. Feel free to use the provided sers/verification/breakpulse.go program.