wjasper / Linux_Drivers

Open source Linux device drivers
GNU General Public License v3.0
110 stars 64 forks source link

Recover 1208FS-Plus if disconnected? #27

Closed CodeFatherG closed 5 years ago

CodeFatherG commented 5 years ago

Hi @wjasper ,

I was wondering if you might have a code snippet to recover connection to the 1208FS-Plus if it is disconnected? I want to ensure that if the connection is lost with the device that I can regain control of the device, any ideas?

Thanks, Grant.

wjasper commented 5 years ago

Hi Grant, This is more of a USB question than specific to the 1208FS-Plus. If you just unplug the device from the the USB bus, the handle is stale. Depending on exactly what happened, you need to close things down (look at the 'e' option in the test code), and then restart everything over (The first first lines in test-usb1208FS-Plus). You may need to put a watchdog timer in your code to check that the device is still responding if that is going to be an issue. Good luck, Warren