Hi guys,
do you know how to configure serial port RS-232 to use flow control??
The reason is without flow control is is not working properly(dala loss etc...)
Im trying to run it as it is just with setting the flow control flag and Im sending my data via loop-back on the rs-232 to GTK TERM on the same computer... but when I enable IXON/IXOFF in GTK TERM, my sending program cant even open the port...
My current settings is:
Code:
struct termios termios_p;
//ferme_port();
tcgetattr(sc.fd, &termios_p);
termios_p.c_cflag = B9600;
termios_p.c_cflag |= CS8;
termios_p.c_cflag |= CREAD;//Enable receiver
termios_p.c_cflag |= CLOCAL;//Ignore modem status lines
//termios_p.c_cflag &= ~ICANON;
termios_p.c_iflag = IGNPAR | IGNBRK;//Ignore characters with parity errors | Ignore break condition
termios_p.c_iflag |=(IXON);//|IXOFF|IXANY);
/*
termios_p.c_cflag &= ~PARENB;
termios_p.c_cflag &= ~CSTOPB;
termios_p.c_cflag &= ~CSIZE;
termios_p.c_cflag &= ~CRTSCTS;
*/
termios_p.c_oflag = 0;
termios_p.c_lflag = 0;
termios_p.c_cc[VTIME] = 0;
termios_p.c_cc[VMIN] = 1;
printf("Configuring the port...");
if(tcsetattr(sc.fd, TCSANOW, &termios_p)==-1){
printf(" ERROR: Unable to configure the port correctly\n");
}else{
printf(" OK\n");
}
tcflush(sc.fd, TCOFLUSH);
tcflush(sc.fd, TCIFLUSH);
Thank you guys