Hello,
I hava some threads, and one of them is to receive commands from other PC with serial port.
The configuration of serial port is:
Quote:
tcgetattr(fd, &options_new);
cfsetispeed(&options_new, B38400);
cfsetospeed(&options_new, B38400);
options_new.c_cflag |= (CLOCAL | CREAD);
options_new.c_cflag &= ~PARENB;
options_new.c_cflag &= ~CSTOPB;
options_new.c_cflag &= ~CSIZE;
options_new.c_cflag |= CS8;
options_new.c_cflag &= ~(IXON | IXOFF | IXANY);
options_new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
options_new.c_cc[VMIN] = 0;
options_new.c_cc[VTIME] = 0;
tcsetattr(fd, TCSANOW, &options_new);
|
I supposed that raw input allow me to receive all values without any problem, but when I send this comand for example:
Quote:
0x01 0x04 0x11 0x45 0x1f 0x67 crc
|
The problem is that 3 byte is backspace I my program receive this:
Quote:
0x01 0x04 0x45 0x1f 0x67 crc
|
In few words, byte 0x11 (backspace) delete one byte.
How can I configure serial port to receive all charcaters without theese problems.
Best regards.