WinUSB help needed - setup packet with non-zero length.
- From: FlownTheCoop <FlownTheCoop.2x3mzi@xxxxxxxxxxxxx>
- Date: Tue, 18 Sep 2007 14:34:37 +0530
Hello,
I'm trying to use the WinUSB driver to talk to our device that simply
has bulk in/out endpoints.
The problem comes when I try to send a setup packet to the control
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 defined
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 because
the buffer length parameter is set to 0.
I know this goes against what the USB specification says about the
..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 to
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 member
sent, even if the buffer length parameter is 0?
--
FlownTheCoop
------------------------------------------------------------------------
FlownTheCoop's Profile: http://forums.techarena.in/member.php?userid=31290
View this thread: http://forums.techarena.in/showthread.php?t=819916
http://forums.techarena.in
.
- Prev by Date: Re: Sound does not work on New Used Computer
- Next by Date: Re: Sound does not work on New Used Computer
- Previous by thread: Sound does not work on New Used Computer
- Next by thread: Intel Pro Wirless 2200BG
- Index(es):
Relevant Pages
|