Prev Previous Post   Next Post Next

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

Reply With Quote

Responses to "WinUSB help needed - setup packet with non-zero length."

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
WinUSB in the WDK ... Mark Cerreta Windows XP Device Drivers 1 09-07-2007 02:38 AM
winusb driver damir Windows XP Device Drivers 4 08-26-2006 11:51 PM
VPN performance and QoS Packet Scheduler? Per Salmi Windows XP Work Remotely 2 01-28-2004 12:17 PM
Packet power loss J. Braun Windows XP Network & Web 0 08-01-2003 06:04 PM
Headset setup gives error, help needed Buggy166 Windows XP Hardware 2 07-16-2003 07:26 PM