C# Class LibUsbDotNet.Main.UsbSetupPacket

显示文件 Open project: arvydas/BlinkStickDotNet Class Usage Examples

Public Properties

Property Type Description
Index short
Length short
Request byte
RequestType byte
Value short

Public Methods

Method Description
UsbSetupPacket ( byte requestType, byte request, short value, short index, short length ) : System.Runtime.InteropServices

Creates a new instance of a UsbSetupPacket and initializes all the fields with the following parameters.

Method Details

UsbSetupPacket() public method

Creates a new instance of a UsbSetupPacket and initializes all the fields with the following parameters.
public UsbSetupPacket ( byte requestType, byte request, short value, short index, short length ) : System.Runtime.InteropServices
requestType byte See .
request byte See .
value short See .
index short See .
length short See .
return System.Runtime.InteropServices

Property Details

Index public_oe property

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

Length public_oe property

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.
public short Length
return short

Request public_oe property

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.
public byte Request
return byte

RequestType public_oe property

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.
    Characteristics of request:
  • D7: Data transfer direction
  • 0 = Host-to-device
  • 1 = Device-to-host
  • D6...5: Type
  • 0 = Standard
  • 1 = Class
  • 2 = Vendor
  • 3 = Reserved
  • D4...0: Recipient
  • 0 = Device
  • 1 = Interface
  • 2 = Endpoint
  • 3 = Other
  • 4...31 = Reserved
public byte RequestType
return byte

Value public_oe property

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