Like the question suggests, I would like to know if there is a way to increase my VMIN with serial programming. I am using a USB device that opens a Virtual Serial Port as an endpoint in Linux. The device will send a variable size message between 7 and 2047 bytes. When I try to program my port in C++, I am getting an overflow on my VMIN value. My code is as follows
portSettings.c_lflag &= ~(ICANON);
portSettings.c_lflag &= ~(ECHO | ECHOE);
portSettings.c_oflag &= ~(ONLCR);
portSettings.c_cc[VMIN] = 2047;
portSettings.c_cc[VTIME] = 10;
tcsetattr(fd, TCSANOW, &portSettings);
I get an "error: unsigned conversion from 'int' to 'cc_t' {aka 'unsigned char'} changes value from '2047' to '255' [Werror=overflow].
Since I don't know how large the incoming message will be, I put the 1 second VTIME and, if it short, then I will get whatever is there, otherwise, I would expect that my max would come in within time with a 115200 baud rate.
Any suggestions?