UsbSetupPacket Structure

LibUsbDotNet

LibUsbDotNet 2.2.8 UsbSetupPacket Structure
Library ReferenceLibUsbDotNet.MainUsbSetupPacket
LibUsbDotNet on SourceForge
Transfers data to the main control endpoint (Endpoint 0).
Declaration Syntax
C# Visual Basic Visual C++
public struct UsbSetupPacket
Public Structure UsbSetupPacket
public value class UsbSetupPacket
Members
All Members Constructors Fields



Icon Member Description
UsbSetupPacket(Byte, Byte, Int16, Int16, Int16)
Creates a new instance of a UsbSetupPacket and initializes all the fields with the following parameters.

Index
The contents of this field vary according to the request. It is used to pass a parameter to the device, specific to the request.

Length
This field specifies the length of the data transferred during the second phase of the control transfer. The direction of data transfer (host-to-device or device-to-host) is indicated by the Direction bit of the RequestType field. If this field is zero, there is no data transfer phase. On an input request, a device must never return more data than is indicated by the wLength value; it may return less. On an output request, wLength will always indicate the exact amount of data to be sent by the host. Device behavior is undefined if the host should send more data than is specified in wLength.

Request
This field specifies the particular request. The Type bits in the bmRequestType field modify the meaning of this field. This specification defines values for the bRequest field only when the bits are reset to zero, indicating a standard request.

RequestType
This bitmapped field identifies the characteristics of the specific request. In particular, this field identifies the direction of data transfer in the second phase of the control transfer. The state of the Direction bit is ignored if the wLength field is zero, signifying there is no Data stage. The USB Specification defines a series of standard requests that all devices must support. In addition, a device class may define additional requests. A device vendor may also define requests supported by the device. Requests may be directed to the device, an interface on the device, or a specific endpoint on a device. This field also specifies the intended recipient of the request. When an interface or endpoint is specified, the wIndex field identifies the interface or endpoint.

Value
The contents of this field vary according to the request. It is used to pass a parameter to the device, specific to the request.

Remarks
All USB devices respond to requests from the host on the device’s Default Control Pipe. These requests are made using control transfers. The request and the request’s parameters are sent to the device in the Setup packet. The host is responsible for establishing the values passed in the fields. Every Setup packet has eight bytes.

Assembly: LibUsbDotNet (Module: LibUsbDotNet) Version: 2.2.8.104 (2.2.8.104)