kopia lustrzana https://github.com/sq5bpf/k5prog
Set both `cfsetospeed` and `cfsetispeed`
rodzic
241ab18b61
commit
cca2dc9530
1
k5prog.c
1
k5prog.c
|
@ -199,6 +199,7 @@ int openport(char *port,speed_t speed)
|
||||||
my_termios.c_cflag = CS8 |CREAD | CLOCAL | HUPCL;
|
my_termios.c_cflag = CS8 |CREAD | CLOCAL | HUPCL;
|
||||||
cfmakeraw(&my_termios);
|
cfmakeraw(&my_termios);
|
||||||
cfsetospeed(&my_termios, speed);
|
cfsetospeed(&my_termios, speed);
|
||||||
|
cfsetispeed(&my_termios, speed);
|
||||||
if ( tcsetattr(fd, TCSANOW, &my_termios))
|
if ( tcsetattr(fd, TCSANOW, &my_termios))
|
||||||
{
|
{
|
||||||
printf("tcsetattr error %d %s\n", errno, strerror(errno));
|
printf("tcsetattr error %d %s\n", errno, strerror(errno));
|
||||||
|
|
Ładowanie…
Reference in New Issue