1
Discussion - Drivers / Errors with functions FT_GetQueueStatus() and FT_Read() of D2XX
« on: August 21, 2019, 08:32:06 PM »
Hello people, I'm working with a USB device which incorporates a FT232R chip. I'm using the D2XX library to communicate with the device from a custom C++ software. The data is read as 17 bytes at a time, and to ensure the reading doesn't fail it is queried the number of available bytes inside a loop until this number is greater or equal to 17. The number of available bytes is got with the function FT_GetQueueStatus(). After of facing many errors, I discovered it was necessary to put a delay of 70ms approximately between the calling of FT_GetQueueStatus() which states that the necessary number of bytes are available and the calling of FT_Read(), to avoid reading errors.
Why did I have to put that delay? Isn't it supposed if the needed bytes are available, the reading operation shouldn't fail? Is it the same to use FT_GetQueueStatus() or FT_GetStatus() to get the number of available bytes in the receive queue?
Why did I have to put that delay? Isn't it supposed if the needed bytes are available, the reading operation shouldn't fail? Is it the same to use FT_GetQueueStatus() or FT_GetStatus() to get the number of available bytes in the receive queue?