--- a/src/asy.c 2002-09-06 19:29:26.000000000 +0200 +++ b/src/asy.c 2026-10-16 22:35:32.052233582 +0200 @@ -33,7 +33,7 @@ static byte PendingDataBuffer; static int PendingData = FALSE; -static struct termio OriginalSerialParameters; +static struct termios OriginalSerialParameters; /******************************************************************************* @@ -52,7 +52,7 @@ static struct termio OriginalSerialParam int asy_open(char *Port, int Baud) { - struct termio SerialParameters; + struct termios SerialParameters; int i, fd; /* We want to open the port in nodelay mode, so we are informed if the @@ -73,26 +73,28 @@ int asy_open(char *Port, int Baud) } /* Now change the rest of the parameters - non-canonical input, etc. */ - if (ioctl (fd, TCGETA, &SerialParameters) == -1) { + if (tcgetattr (fd, &SerialParameters) == -1) { #ifdef DEBUG fprintf (stderr, "asy_open: Cannot ioctl (get) on port %s. Errno = %d\n", Port, errno); #endif return -1; } - (void) ioctl (fd, TCGETA, &OriginalSerialParameters); + (void) tcgetattr (fd, &OriginalSerialParameters); SerialParameters.c_cflag = Baud | CS8 | CLOCAL | CREAD | CRTSCTS; SerialParameters.c_lflag = 0; SerialParameters.c_oflag = 0; SerialParameters.c_iflag = IGNBRK | IGNPAR; - for (i = 0; i < NCC; i++) + cfsetispeed (&SerialParameters, Baud); + cfsetospeed (&SerialParameters, Baud); + for (i = 0; i < NCCS; i++) SerialParameters.c_cc[i] = (unsigned char) 0; SerialParameters.c_cc[VMIN] = (unsigned char) 0; SerialParameters.c_cc[VTIME] = (unsigned char) DataTimeout; - if (ioctl (fd, TCSETA, &SerialParameters) == -1) { + if (tcsetattr (fd, TCSANOW, &SerialParameters) == -1) { #ifdef DEBUG fprintf (stderr, "asy_open: Cannot ioctl (set) on port %s. Errno = %d\n", Port, errno); #endif @@ -115,7 +117,7 @@ int asy_open(char *Port, int Baud) void asy_close(int fd) { - if (ioctl (fd, TCSETA, &OriginalSerialParameters) == -1) { + if (tcsetattr (fd, TCSANOW, &OriginalSerialParameters) == -1) { #ifdef DEBUG fprintf (stderr, "asy_close: Cannot ioctl (reset). Errno = %d\n", errno); #endif