Hello Bytes,
I am writing a program in Linux Debian x86 to control a module.
My only problem is that the module needs to have the DTR setting and all flow control off. I have been unable to figure out how to do this.
This is how ive configured my port settings thus far:
Any ideas??
I am writing a program in Linux Debian x86 to control a module.
My only problem is that the module needs to have the DTR setting and all flow control off. I have been unable to figure out how to do this.
This is how ive configured my port settings thus far:
Any ideas??
Code:
fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY);
if ( fd == -1) // if open is unsucessful
{
perror("open_port: Unable to open /dev/ttyUSB0 - ");
} else {
fcntl( fd, F_SETFL, 0);
}
struct termios port_settings; // structure to store the port settings in
cfsetispeed(&port_settings, B57600); // set baud rates
cfsetospeed(&port_settings, B57600);
port_settings.c_cflag &= ~PARENB; // set no parity, stop bits, data bits
port_settings.c_cflag &= ~CSTOPB;
port_settings.c_cflag &= ~CSIZE;
port_settings.c_cflag |= CS8;
tcsetattr( fd, TCSANOW, &port_settings); // apply the settings to the port
Comment