&"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"
bool rs485::rs485ConfigPort()
{
termios portSettings;
memset(&portSettings, 0, sizeof(portSettings));
portSettings.c_cflag |= (CLOCAL | CREAD);
cfsetispeed(&portSettings, B57600);
portSettings.c_cflag &= ~PARENB;
portSettings.c_cflag |= CS8;
portSettings.c_cflag &= ~CSIZE;
portSettings.c_cflag &= ~CSTOPB; //stop bit = 1
//cfmakeraw(&portSettings);
if (tcsetattr(fd, TCSANOW, &portSettings))
{
emit logMessage("Can not adjust port settings");
close(fd);
return false;
}
tcflush(fd, TCIFLUSH);
return true;
}
I found the problem, this is because tcsetattr() gives back Input/Output Error. the device is open with write permissions. and... when I do dmesg | grep ttyS0 or S1-3, I do not receive anything! it also follows sometimes with the error "No such device".
anybody can help solve this problem?