Heinrich du Toit
2018-05-21 06:15:03 UTC
Hi
I am using libFTDI on a FT4232H device.
We are attempting to read a stream of serial data that consist out of different packets being sent at roughly 50Hz.
Meaning 50 packets (each about 25 bytes) every 5msecs.
I'm using the asynchronous read API.
What I noticed is that the asynchronous read will tend to fill up the buffer I give it before completion.
So if I give it a buffer of 1024 bytes it will remain reading until all 1024 bytes are received.
This is not ideal for our case as I would like the read to complete ideally after the first 25 bytes have been received.
(I've set the latency timer value to "2" currently)
I realize this has something to do with how asynchronous I/O works in libusb but would it be possible to modify this behaviour in some way?
I am willing to change the code of libftdi as I'm already running a slightly modified version of it for reasons.
I am even willing to modify libusb if that would fix the issue but would prefer that not being necessary.
Any advise to where I should be looking for a solution would be appreciated.
Thank you
Heinrich du Toit
Specialist Engineer: Software
[cid:emailfooterbase_93ec2d11-74f4-4d98-9ea6-a2dc6dcb552e.png]<http://www.s-plane.com>
Disclaimers are available at: http://www.s-plane.com/disclaimer
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com
I am using libFTDI on a FT4232H device.
We are attempting to read a stream of serial data that consist out of different packets being sent at roughly 50Hz.
Meaning 50 packets (each about 25 bytes) every 5msecs.
I'm using the asynchronous read API.
What I noticed is that the asynchronous read will tend to fill up the buffer I give it before completion.
So if I give it a buffer of 1024 bytes it will remain reading until all 1024 bytes are received.
This is not ideal for our case as I would like the read to complete ideally after the first 25 bytes have been received.
(I've set the latency timer value to "2" currently)
I realize this has something to do with how asynchronous I/O works in libusb but would it be possible to modify this behaviour in some way?
I am willing to change the code of libftdi as I'm already running a slightly modified version of it for reasons.
I am even willing to modify libusb if that would fix the issue but would prefer that not being necessary.
Any advise to where I should be looking for a solution would be appreciated.
Thank you
Heinrich du Toit
Specialist Engineer: Software
[cid:emailfooterbase_93ec2d11-74f4-4d98-9ea6-a2dc6dcb552e.png]<http://www.s-plane.com>
Disclaimers are available at: http://www.s-plane.com/disclaimer
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com