thorpej / nabud

A server for the NABU PC
Other
29 stars 9 forks source link

Custom baud rate fix for Linux (not sexy) #18

Closed Sch-LikA closed 1 year ago

Sch-LikA commented 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 :

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.

thorpej commented 1 year ago

This issue is fixed by commit b9ab7e3 on the dev/v1.3 branch.