Chapter 4 Software Developmentpage 4-74-1-10. Device RequestsDevice requests represent commands from the host to USB functions using control transfers. TheUSB function parses the request, performs the necessary action, and returns the appropriateresponse.There are three types of device requests.Table 4.1.6. Device Request TypesStandard Requests that all USB devices must support because they hold the key to hot plugging(a.k.a. dynamic insertion and removal)Class-specific Requests required by the USB Device Class Specifications for the general applicationVendor-specific Requests implemented by the vendor for accessing functionality particular to the USBdeviceA control transfer starts with a SETUP token packet followed by an 8-byte data packet containingthe following fields. Note that the meaning of the wValue and wIndex fields depends on the requesttype.Table 4.1.7. Control Transfer Data PacketbmRequestType 1byte Transfer direction, request type, and endpoint addressbRequest 1byte Request numberwValue 2byte Value (meaning depends on the request type)wIndex 2byte Index or offset (which depends on the request type)wLength 2byte Number of bytes transferred during the Data stageA control transfer consists of up to three stages.1. Setup stage: The data packet following the SETUP token packet is an 8-byte command from thehost to the device. The device parses the command and, as necessary, prepares to send orreceive data.2. Data stage: The pipe transfers the specified data in the direction specified by the command.Note that commands that do not involve data transfer skip this stage.3. Status stage: The host initiates a transaction, in the direction opposite the immediatelypreceding data transfer, for reporting command success or failure from the device to the host.4-1-11. Standard Device RequestsThe standard device requests are common ones to all USB devices. Most important are those thatsupport hot plugging (a.k.a. dynamic insertion and removal). Detailed descriptions are in Section 9.-4 of the USB version 1.1 specifications.Table 4.1.8. Standard Device RequestsNo. Request Name Description0 GET_STATUS Return status for specified recipient1 CLEAR_FEA TURE Clear or disable a specific feature3 SET_FEATURE Set or enable a specific feature5 SET_ADDRESS Set device address for al future device accesses6 GET_DESCRIPTOR Return the specified descriptor, if it exists