USB Device Request Command

Source: Internet
Author: User

USB Device Request Command: Bmrequesttype + brequest + wvalue + Windex + wlength

Number Value Name

(0) 0 Get_status: Used to return the status of a specific recipient
(1) 1 clear_feature: To remove or prohibit certain features of the receiver

(x) 2 for future retention
(2) 3 set_feature: Some of the features used to enable or activate the command receiver

(x) 2 for future retention
(3) 5 set_address: Used to assign an address to a device
(4) 6 Get_descriptor: Specific descriptor for host acquisition device
(5) 7 Set_descriptor: Modify the relevant descriptor in the device, or add a new descriptor
(6) 8 get_configuration: The configuration value of the current device for the host acquisition device (note the difference above)
(7) 9 set_configuration: Configuration for the requirements used by the host to indicate the device
(8) Get_interface: Used to get the current interface descriptor number
(9) One-set_interface: For the host requires the device to describe the interface with a descriptor
(Ten) Synch_frame: Synchronization frame for device setup and reporting of one endpoint

The following table lists the standard device requests:

The following table is the standard request code:

The following table describes the descriptor types:

The USB device must respond to standard device requests, regardless of whether the device is assigned an address or whether it is configured.

The device attribute selector is used when setting properties such as the following table

If there is an unsupported or undefined request for a USB device, the device will return a stall in the data or status phase. If the device finds an error during the setup phase, the device first returns a stall before data or stauts. Illegal requests do not make the device halt. If, for some reason, the device is unable to communicate with the host through the default control pipe because of an error, the device must be reset to clear the error state and restart the default state.

The following descriptions refer to figure 9-3

1,clear Feature. This request is used to clear or make no specified property.

Wvalue must select a specific value based on the recipient. The receiver is the device with the device descriptor, the interface is the interface descriptor, the port is the port descriptor. When a clear feature requests an attribute that cannot be cleared or does not exist, or refers to a nonexistent interface or port, a request Error is returned. If Wlength is not 0, the device response is undefined.

By default, the response to the request is not defined at this time.

Address State, the response to the request is defined at this time, but cannot be a request to an interface or port, only port 0, otherwise the response is request Error.

Configuration state, the response to the request is defined at this time.

2,get Configuration. This request is used to obtain the configuration value of the current device. If Wvalue,windex,wlength is not the default value, then the device response is undefined.

By default, no device response is defined.

Address state, a value of 0 is returned.

In the configuration state, bconfiguration values other than 0 are returned.

3,get Descriptor. This request returns a descriptor that exists. The high-level in Wvalue gives the descriptor type, and the low-level gives the descriptor index. Describes the index character used to give a specific descriptor. Windex gives a 0 or language ID. Wlength gives the number of bytes to return. If the description table is longer than Wlegnth, only the initial part of the description table is returned, otherwise a short packet is sent to describe the completion of the interrupt transfer. In 3 states, requests are legal.

4,get Interface. This request returns an optional configuration for the selected interface. Some USB have a configuration of mutually exclusive settings between interfaces. This request allows the host to determine the settings. Wvalue and wlength are not default values, and device response is undefined. If the pretext is not present, the request error is returned.

By default, the device has no definition for this request response at this time.

The device returned a request error in the address state.

Configuration state, the request is legitimate.

5,get Status. This request returns the status of the selected recipient. The recipient bit in the Bmrequesttype indicates the recipient. The return value is the state of the specified recipient. The device response is undefined if wvalue and wlength are not the default values or if the Windex is in the fetching state.

By default, no device response is defined.

Address state, if the reference is an interface or a port other than 0, the device returns a request error.

Configuration state, if the indicated interface or port does not exist, returns a request error.

6,set Address. This request sets the device address for future device access. USB devices can change the device address only after the status phase has completed successfully. If the device address is greater than 127, or Windex or wlength is not 0, the device response is undefined. The device is not responding to setaddress (0).

By default, if the address value is not 0, the device enters the address state, otherwise it is still in the default state.

Address state, if the new address is 0, then the device enters the default state, otherwise it is still in the address state.

Configuration state, the device responds to this request without definition.

7,set Configuration. Sets the configuration value. This request sets the device configuration value. The low byte of the wvalue indicates the specified configuration. This configuration value must be 0 or match one of the configurations in the Configuration description table. If the configuration value is 0, the device is the address state. Wvalue high-byte retention. If the high byte of Windex,wlength,wvalue is not 0, then the device response to this request is undefined.

By default, the response to this request is undefined.

Address state, if the specified configuration value is 0, then the device is still in the address state. If the configuration and configuration tables that you refer to match, go to the appropriate configuration. Otherwise, the request is returned incorrectly.

Configuration state, if the specified configuration value is 0, then the device enters the address state. If the configuration and configuration tables that you refer to match, go to the appropriate configuration. Otherwise, the request is returned incorrectly.

8,set Descriptor. Sets a descriptor. This request is optional for adding or updating a new description table. The high byte of the wvalue indicates the descriptor type, and the low byte indicates the descriptor index. Describes the Fusso reference to give the correct descriptor. Because a device can have different descriptors. For a description table that can be set by SetDescriptor (), its descriptor index must be 0. The descriptor index ranges from 0 to the descriptor range value minus 1. Windex indicates the string descriptor language ID, which is set to 0 for other descriptors. Wlength indicates the length of the transmitted data. Device-supported descriptors are 3 descriptors of device, configuration, and string. If the device does not support the request, a request error is returned.

By default, the device has no definition of the request response.

Address status, if the request is supported, it is legal.

Configuration state, if the request is supported, it is legal.

9,set Feature. Set the attribute to take effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.