USB services: Difference between revisions
No edit summary |
|||
Line 44: | Line 44: | ||
SerialNumber: SerialNumber | SerialNumber: SerialNumber | ||
The following is the default <code>lsusb -v {...}</code> output when the usbds service wasn't used. The endpoints are configured using [[#GetDsEndpoint]], the total number of endpoints is the number of open [[#IDsEndpoint]] sessions. | The following is the default <code>lsusb -v {...}</code> output when the usbds service wasn't used. | ||
The endpoints are configured using [[#GetDsEndpoint]], the total number of endpoints is the number of open [[#IDsEndpoint]] sessions. bInterfaceNumber is {0-based index for the enabled [[#IDsInterface]] session.} Some of the interface fields are configured using [[#GetDsInterface]]. | |||
Bus 003 Device 006: ID 057e:2000 Nintendo Co., Ltd | Bus 003 Device 006: ID 057e:2000 Nintendo Co., Ltd | ||
Line 106: | Line 108: | ||
== BindComplex == | == BindComplex == | ||
Takes an u32 ('''complexId'''). [[Manu_Services|Manu]] sends 0x02. | Takes an u32 ('''complexId'''). [[Manu_Services|Manu]] sends 0x02. | ||
Once this command is used, the USB device will not be listed with <code>lsusb</code> until [[#EnableInterface]] is used. | |||
== BindClientProcess == | == BindClientProcess == | ||
Line 112: | Line 116: | ||
== GetDsInterface == | == GetDsInterface == | ||
Takes 2 type-5 buffers and returns an [[#IDsInterface]]. [[Manu_Services|Manu]] sends a 0x09-byte command (e.g.: 0x09, 0x04, 0x04, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00) in the first buffer and a string ("usb") in the second buffer. | Takes 2 type-5 buffers and returns an [[#IDsInterface]]. [[Manu_Services|Manu]] sends a 0x09-byte command (e.g.: 0x09, 0x04, 0x04, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00) in the first buffer and a string ("usb") in the second buffer. | ||
Structure of the first buffer(this is similar to [http://libusb.sourceforge.net/api-1.0/structlibusb__interface__descriptor.html libusb__interface__descriptor]): | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x1 || bLength | |||
|- | |||
| 0x1 || 0x1 || ? | |||
|- | |||
| 0x2 || 0x1 || ? | |||
|- | |||
| 0x3 || 0x1 || ? | |||
|- | |||
| 0x4 || 0x1 || ? | |||
|- | |||
| 0x5 || 0x1 || bInterfaceClass | |||
|- | |||
| 0x6 || 0x1 || bInterfaceSubClass | |||
|- | |||
| 0x7 || 0x1 || bInterfaceProtocol | |||
|- | |||
| 0x8 || 0x1 || ? | |||
|} | |||
== GetStateChangeEvent == | == GetStateChangeEvent == | ||
Line 182: | Line 210: | ||
=== EnableInterface === | === EnableInterface === | ||
Takes no arguments. Enables the current interface. | Takes no arguments. Enables the current interface. | ||
Only one interface can be enabled at time, this indicates which interface is actually used for USB. | |||
=== DisableInterface === | === DisableInterface === |