> Well, wait a minute here. If you are waiting for the "bulk in" in the
> middle, how could you possibly get the sequence you just described?
> You wouldn't even send the second 1KB until you'd read the first
> response. Are you sending the two "bulk out" calls consecutively,
> without waiting for the "bulk in" in the middle? If so, then what you
> show is quite possible.

Exactly, that's why I was so baffled. I'm using synchronous function calls 
consecutively in a single (main) thread, so I expected each transfer to 
complete before the next call. But that's not what's happening.

> There is a flag to ask for a zero-length terminator
> (LIBUSB_TRANSFER_ADD_ZERO_PACKET), but I'm not sure it's available on
> Windows. You should, however, be able to do another bulk out
> transaction with a zero-length buffer. So, send 1K, send 0, send 1K,
> send 0.

I thought that might be the issue, so I looked through the libusbx source to 
see if I could add it my self, but with all the indirection and nested function 
pointer arrays, I couldn't follow the logic down to the WinUSB calls. It will 
take me a lot more time to figure out what the code is doing. I assume there is 
a reason the ZLP hasn't been implemented in Windows yet. What will it require?

I tried sending a zero length transfer, after each "bulk out" transfer, but 
setting the length to zero causes the function to timeout and no packet is seen 
on the wire, so the behavior persists.

> Do you actually have multiple interfaces? Did you write your INF to
> match the composite device, or did you match the specific interface you
> want (with &MI_01, for example)?

I just installed the driver with Zadig. Yes there are two interfaces, interface 
0 has a single endpoint and interface 1 has the two bulk end points. What 
confused me was that using libusbx I am able to use the bulk endpoints, but 
with the WinUSB API I can't. I'm testing on the same system with the same 
driver configuration. There must be something I'm missing, I'm following the 
Microsoft example on Using WinUSB functions.

~QSE                                      
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to