Closed Sch-LikA closed 1 year ago
Having had issues setting the 111860 baud rate on my linux machine, I finally found some working combination of black magic to get there :
... struct termios2 tio; ioctl(fd, TCGETS2, &tio); tio.c_cflag &= ~CBAUD; tio.c_cflag |= BOTHER; tio.c_ispeed = speed; tio.c_ospeed = speed; int r = ioctl(fd, TCSETS2, &tio); ...
This is a mix of gists / stackoverflow / ... stuff but seems to work.
You are supposed to do the POSIX stuff first, then that ugly not portable stuff.
This issue is fixed by commit b9ab7e3 on the dev/v1.3 branch.
Having had issues setting the 111860 baud rate on my linux machine, I finally found some working combination of black magic to get there :
include
include <asm/termios.h>
... struct termios2 tio; ioctl(fd, TCGETS2, &tio); tio.c_cflag &= ~CBAUD; tio.c_cflag |= BOTHER; tio.c_ispeed = speed; tio.c_ospeed = speed; int r = ioctl(fd, TCSETS2, &tio); ...
This is a mix of gists / stackoverflow / ... stuff but seems to work.
You are supposed to do the POSIX stuff first, then that ugly not portable stuff.