1
General Discussion / Re: Can a timeout be set on FT_purge?
« on: June 29, 2020, 05:26:02 PM »
Thanks for the reply!
We're already using FT_CyclePort and in the event of e.g. FT_IO_ERROR (which is indeed what we mostly get) after FT_Read or FT_Write we use it to succesfully reconnect.
However we can only do so when there's effectively an error, which isn't the case if FT_Purge never returns..
So is it correct that there's no way to keep FT_Purge from blocking? That would mean we cannot really use it, as it stalls the software in case something goes wrong; well, I guess unless we use a separate thread to measure how long it's been running and then call FT_CyclePort from the other thread but I'm not sure the FTDI functions are threadsafe for use like that?
We're already using FT_CyclePort and in the event of e.g. FT_IO_ERROR (which is indeed what we mostly get) after FT_Read or FT_Write we use it to succesfully reconnect.
However we can only do so when there's effectively an error, which isn't the case if FT_Purge never returns..
So is it correct that there's no way to keep FT_Purge from blocking? That would mean we cannot really use it, as it stalls the software in case something goes wrong; well, I guess unless we use a separate thread to measure how long it's been running and then call FT_CyclePort from the other thread but I'm not sure the FTDI functions are threadsafe for use like that?