|
From: <and...@nt...> - 2006-09-20 09:57:25
|
Hi I don't understand the behavior of subsequent read/write operations when = using usb_release_interface() and usb_claim_interface() between the = read/writes. My test device is a AT90SUB1287 and loops the data from an OUT bulk = endpoint to an IN bulk endpoint. I'm using the latest CVS source, but I had the same problem with the = official libusb-win32-snapshot 20060827. This scenario works fine: **************************** - usb_open() - usb_set_configuration() - usb_claim_interface() - usb_set_altinterface() - usb_bulk_write() (multiple read/writes work fine) - usb_bulk_read() - usb_release_interface() - usb_close() This scenario gives me a timeout error, but read/write work after some = timeout errors again: **************************** - usb_open() - usb_set_configuration() - usb_claim_interface() - usb_set_altinterface() - usb_bulk_write() (works fine, I get the data on the device) - usb_release_interface() ** - usb_claim_interface() - usb_set_altinterface() - usb_bulk_read() (works fine, I get the data from the device) - usb_release_interface() ** - usb_claim_interface() - usb_set_altinterface() - usb_bulk_write() (no failure (libusb), but I don't get any data on = the device) - usb_release_interface() ** - usb_claim_interface() - usb_set_altinterface() - usb_bulk_write() (no failure (libusb), but I don't get any data on = the device) - usb_bulk_read() (fails, timeout error) - usb_bulk_write() (works fine, I get the data on the device) - usb_bulk_read() (fails, timeout error) - from now on all read/write are successful again - usb_release_interface() - usb_close() **************************** Is it not allowed to claim the interface again after release? I'm wondering why writing to the device succeeds, although I don't get = any data on the device? I can write as many times as I want without = getting an error from libusb. The device can buffer only one transfer. Strange is, that it starts working again after some subsequent = write/reads. Any hints are appreciated! Thanks, Andreas |