4.1.1 Set Request
This request is used to set an attribute of a Control inside an entity of the video function.
Table 4-1 Set Request
bmRequestType | bRequest | wValue | wIndex | wLength | Data |
---|---|---|---|---|---|
00100001 | SET_CUR | See following paragraphs | Entity ID and Interface | Length of parameter block | Parameter block. |
00100010 | Endpoint |
The bmRequestType field specifies that this is a SET request (D7=0). It is a class-specific
request (D6..5=01), directed to either the VideoControl interface, or a VideoStreaming interface
of the video function (D4..0=00001), or the video data endpoint of a VideoStreaming interface
(D4..0=00010).
The bRequest field contains a constant that identifies which attribute of the addressed Control is
to be modified. Possible attributes for a Control are:
- Current setting attribute (SET_CUR)
If the addressed Control or entity does not support modification of a certain attribute, the control
pipe must indicate a stall when an attempt is made to modify that attribute. Only the CUR
attribute is supported for the Set request. For the list of Request constants, refer to section A.8,
“Video Class-Specific Request Codes”
The wValue field interpretation is qualified by the value in the wIndex field. Depending on what
entity is addressed, the layout of the wValue field changes. The following paragraphs describe
the contents of the wValue field for each entity separately. In most cases, the wValue field
contains the Control Selector (CS) in the high byte. It is used to address a particular Control
within entities that can contain multiple Controls. If the entity only contains a single Control,
there is no need to specify a Control Selector and the wValue field can be used to pass additional
parameters.
The wIndex field specifies the interface or endpoint to be addressed in the low byte, and the
entity ID or zero in the high byte. In case an interface is addressed, the virtual entity “interface”
can be addressed by specifying zero in the high byte. The values in wIndex must be appropriate
to the recipient. Only existing entities in the video function can be addressed, and only
appropriate interface or endpoint numbers may be used. If the request specifies an unknown or
non-entity ID or an unknown interface or endpoint number, the control pipe must indicate a stall.
The actual parameter(s) for the Set request are passed in the data stage of the control transfer.
The length of the parameter block is indicated in the wLength field of the request. The layout of
the parameter block is qualified by both the bRequest and wIndex fields. Refer to the following
sections for a detailed description of the parameter block layout for all possible entities.
- 在同一个config下有多个interface assoc 为video功能时,需要注意wIndex字段,表示控制请求针对的interface
- 本文作者: crazyboy
- 本文链接: http://crazyboy.www.crazyboy.info/blog/blog/2022/09/29/it/withoutiso/protocol/uvc/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!