Hello Yegor,
On Friday, 21 April 2017 09:42:27 CEST Yegor Yefremov wrote:
> # reset FTDI device
> if ftdi.usb_reset(context) != 0:
> print("Failed to reset FTDI device")
> return False
sorry, missed that part yesterday.
> # close FTDI device
> if ftdi.usb_close(context) != 0:
> print("Failed to close FTDI device")
> return False
>
> > Thought ftdi_usb_open() calls that internally anyway.
>
> Original FTDI API has two functions:
>
> FT_ResetDevice and FT_CyclePort. The latter is suitable for my case:
>
> "The effect of this function is the same as disconnecting then
> reconnecting the device from USB. Possible use of this function is
> situations where a fatal error has occurred and it is difficult, or
> not possible, to recover without unplugging and replugging the USB
> cable. This function can also be used after reprogramming the EEPROM
> to force the FTDI device to read the new EEPROM contents which would
> otherwise require a physical disconnect-reconnect."
>
> Though this routine is marked as "Windows (2000 and later) ".
>
> Any idea?
may be this helps:
https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line
Source for the short program:
http://marc.info/?l=linux-usb&m=121459435621262&w=2
Cheers,
Thomas
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|