Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BOTHER to set the baudrate #17

Open
yegorich opened this issue Oct 29, 2019 · 2 comments
Open

Use BOTHER to set the baudrate #17

yegorich opened this issue Oct 29, 2019 · 2 comments

Comments

@yegorich
Copy link
Contributor

Use the modern way to set the baudrate using an integer and not a macro.

struct termios2 tio;

ioctl(fd, TCGETS2, &tio);
tio.c_cflag &= ~CBAUD;
tio.c_cflag |= BOTHER;
tio.c_ispeed = 12345;
tio.c_ospeed = 12345;
ioctl(fd, TCSETS2, &tio);

For more information see: https://stackoverflow.com/a/19992472/1113139

@cbrake
Copy link
Owner

cbrake commented Oct 29, 2019

I like the idea of adding this code.

Is there any risk this new API won't work on some older systems? If so, should we offer both, default to the new, and perhaps have a command line option to force the old method if needed?

@yegorich
Copy link
Contributor Author

That's a good question. Adding support can be a little bit tricky. See this note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants