C++ API hangs on Open() after a hard disconnect | Cypress Semiconductor
C++ API hangs on Open() after a hard disconnect
I am using the C++ CyAPI.lib to communicate with an FX3, and have implemented a disconnect detection routine using a message window and passing that handle to the CCyUSBDevice constructor. I can detect disconnect events (I'm physically disconnecting the USB cable), during which I raise a flag that causes my data streaming thread to stop and disconnect from USB, and I dispose of all the objects related to the Cypress driver.
However, I am finding that when I go to reconnect to the driver, my program hangs on CCyUSBDevice::Open() after calling it several times. The CCyUSBDevice has already been deleted and reallocated, I have tried calling Reset() before opening it again, checking the status of IsOpen() to see if it was left in an invalid state, and checking UsbdStatus and NtStatus for errors.
Is there anything else I can check on the CCyUSBDevice object that would tell me if there is something that needs to be reset or handled before I can resume normal operations?