How works controlTransfer?

47 views
Skip to first unread message

Roka

unread,
Mar 22, 2023, 4:43:51 AM3/22/23
to usb4java
Any guide about how works controlTransfer and his parameters configuration?

Roka

unread,
Mar 22, 2023, 4:48:35 AM3/22/23
to usb4java
Or any example code about controlTransfer.

El dia dimecres, 22 de març de 2023 a les 9:43:51 UTC+1, Roka va escriure:

Roka

unread,
Mar 23, 2023, 4:37:45 AM3/23/23
to usb4java
I found the usb setup packet diagram, but i dont undertand the paremeters wValue and wIndex.

El dia dimecres, 22 de març de 2023 a les 9:48:35 UTC+1, Roka va escriure:
setuppacket.png

stoibe...@gmail.com

unread,
Mar 23, 2023, 2:08:14 PM3/23/23
to usb4java

Hi,

Here is an example from the USB_Video_Class_1.1 specification:

  • 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. 



Generally the values depends on the usb device. Every device is different and follows it's own code.


So far,

Peter
Reply all
Reply to author
Forward
0 new messages