Hello,
I am trying to communicate with a device via a simple bulk transfer protocol
under 64-bit Win7, it doesn't require high bandwidth. I don't have access to
to the device firmware, but I know it is working properly because I have some
software that communicates with it correctly under WinXP.
The sequence I'm trying to perform is:
[reset device]
[initiate communication]
bulk out - 16 bytes start command
bulk in - 16 bytes ready response
[start processing data]
bulk out - 1KB command 1 with data
bulk in - 16 bytes command 1 response
bulk out - 1KB command 2 with data
bulk in - 16 bytes command 2 response
bulk out - 1KB command 3 with data
bulk in - 16 bytes command 3 response
and so on...
I installed libusbx 1.0.15 using the WinUSB driver, and it works until command
2, when I get an error response. I used a USB sniffer and discovered that I'm
getting a sequence like:
[reset device]
[initiate communication]
bulk out - 16 bytes start command
bulk in - 16 bytes ready response
[start processing data]
bulk out - 2KB command 1 with data followed immediately by command 2 with it's
data
bulk in - 16 bytes command 1 response (OK)
bulk in - 16 bytes command 2 response (error)
Looking deeper, I noticed that the 1KB transferrs should consist of two 512byte
packets followed by a zero byte packet. What I'm seeing are four 512 byte
packets. I'm using synchronous API calls so I expected each of the transfers
to complete before the next call, but it seems that the data is being queued
somehow and sent as a single concatenated transfer so the device doesn't
recognize the second command.
So my question is how can I get the behavior I need with libusbx? Is this
related to the zero length packet issue in Windows?
Originally I started with libusb-win32, and had the same results with the 0.1
API, I thought it might be the driver, so after some searching I found libusbx
and after implementing a test I was dismayed to find the same behavior.
I also tried using the WinUSB API directly, but it only finds the interface
with endpoint 0, rather the interface the bulk endpoints, so I have been unable
to even establish communication with the device. I'd rather use libusbx, but
WinUSB will be fine if I can figure out how to get a handle to the bulk
endpoints.
Thanks for any help,
~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