tecknophreak
10-26-2001, 04:31 PM
I'm using a modified portion of the asynchrounous serial programming from the How-To. The problem is, when I use Telix/Windows Hyper terminal and type 'p' i get something like a backspace and \n or \r.
The terminal is setup as ASCII.
Here's how i set up the serial port:
sfd = open(MODEMDEVICE, O_RDWR | O_NOCTTY);
saio.sa_handler = serial_int;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO, &saio, NULL);
fcntl(sfd, F_SETOWN, getpid());
fcntl(sfd, F_SETFL, FASYNC);
tcgetattr(sfd, &oldtio); newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR | ICRNL;
newtio.c_oflag = 0;
newtio.c_lflag = ICANON;
newtio.c_cc[VMIN] = 1;
newtio.c_cc[VTIME] = 0;
tcflush(sfd, TCIFLUSH);
tcsetattr(sfd, TCSANOW, &newtio);
The terminal is setup as ASCII.
Here's how i set up the serial port:
sfd = open(MODEMDEVICE, O_RDWR | O_NOCTTY);
saio.sa_handler = serial_int;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO, &saio, NULL);
fcntl(sfd, F_SETOWN, getpid());
fcntl(sfd, F_SETFL, FASYNC);
tcgetattr(sfd, &oldtio); newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR | ICRNL;
newtio.c_oflag = 0;
newtio.c_lflag = ICANON;
newtio.c_cc[VMIN] = 1;
newtio.c_cc[VTIME] = 0;
tcflush(sfd, TCIFLUSH);
tcsetattr(sfd, TCSANOW, &newtio);