[Ftdi-usb-sio-devel] Reading more than 255 bytes at once
Brought to you by:
bryder
From: Dennis B. <den...@go...> - 2010-11-25 14:30:22
|
Hello ftdi-usb-sio-devel list! I am using termios to process data on a /dev/ttyUSB*-port. Data is coming in on one of these ports in burst of over 500bytes. I am doing this with kernel 2.6.33.7, which contains FTDI-driver in Version 1.5.0. My serial-hardware is a FT4232 and I am using non-canonical input. My problem is, that I can only read bursts of up to 255 bytes, since the array of control characters within the kernel named c_cc represents only an unsigned char. So, if I set a value higher than 255 to c_cc[VMIN], it won't be set the way I want within the kernel. How would it be possible to read bursts of over 255 bytes? Right now I am doing a workaround, which checks for data within the buffer (ioctl SIOCINQ) of the serial driver and as soon as it gets above a wanted value (let's say 501 bytes), I read the buffer and flush it. I would rather like to do this with select(2) in combination with read(2), which only returns after 501 bytes are available. Is there a way to do this? Very kind regards, Dennis |