WinUSB help needed - setup packet with non-zero length.
Posted: 09-18-2007, 10:04 AM
Hello,
I'm trying to use the WinUSB driver to talk to our device that simpl
has bulk in/out endpoints.
The problem comes when I try to send a setup packet to the contro
endpoint with the following features:
1. The Length member of the setup packet is used in a customised way
to send a checksum byte to the device.
2. There is no buffer and the buffer length is 0.
Example:
WINUSB_SETUP_PACKET setup_packet;
setup_packet.RequestType = 0x40; // Vendor write request
setup_packet.Request = 0x14; // a vendor define
request
setup_packet.Value = 0xdf1b;
setup_packet.Index = 0x4000;
setup_packet.Length = 0x0005; // this is a checksum
if (WinUsb_ControlTransfer(hUSBWINDRIVER->hDevice, setup_packet
NULL, 0, &bytesReturned, NULL))
{
// carry on
}
else
{
// error
}
Looking at the actual data sent down the USB bus, instead of getting
0x40, 0x14, 0x1b, 0xdf, 0x00, 0x40, 0x05, 0x00
I get
0x40, 0x14, 0x1b, 0xdf, 0x00, 0x40, 0x00, 0x00
- the .Length member does not get passed through, presumably becaus
the buffer length parameter is set to 0.
I know this goes against what the USB specification says about th
.Length member but unfortunately, we have devices out in the field
that rely on this information for us to talk to them. (We can talk t
them like this with an old driver that's not Vista compatible.)
Does anyone know how I can get around this, and get the .Length membe
sent, even if the buffer length parameter is 0
--
FlownTheCoo
-----------------------------------------------------------------------
FlownTheCoop's Profile: http://forums.techarena.in/member.php?userid=3129
View this thread: http://forums.techarena.in/showthread.php?t=81991
http://forums.techarena.i




Threaded Mode
