Difference between revisions of "/dev/usb/hid (v5)"

From WiiBrew
< /dev‎ | usb
Jump to: navigation, search
m (Handles)
Line 3: Line 3:
 
''/dev/usb/hid'' is used to interact with USB HIDs in IOS57, 58 and 59.
 
''/dev/usb/hid'' is used to interact with USB HIDs in IOS57, 58 and 59.
  
It is very similar to [[:/dev/usb/ven]] and other v5 interfaces. Some ioctl handlers are identical to USB_VEN, except some sanity checks on input parameters are missing in USB_HID. Both rely on [[:/dev/usb/usb]] for most actions.
+
It is very similar to [[:/dev/usb/ven]] and other v5 interfaces. Some ioctl handlers are identical to USB_VEN. Both rely on [[:/dev/usb/usb]] for most actions.
 
 
Only IOS_OPEN, IOS_CLOSE, IOS_IOCTL and IOS_IOCTLV are valid commands. The other commands immediately return IPC_EINVAL (-4).
 
  
 
== Handles ==
 
== Handles ==
Up to 16 handles can be opened, each with their own device change hook. The handle ID is specified in the open request as the "mode". IPC_EINVAL will be returned if an ID that is in use is passed.
+
Handles for USB_HID function exactly the same as for USB_VEN.
  
 
== Ioctls ==
 
== Ioctls ==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Ioctl !! Name !! Input !! Output
+
! Ioctl !! Name !! Notes
! Notes
+
|-
 +
| 0 || GetVersion || Identical to VEN
 +
|-
 +
| 1 || GetDeviceChange || Identical to VEN
 +
|-
 +
| 2 || Shutdown || Identical to VEN
 +
|-
 +
| 3 || GetDeviceInfo (?) || ?
 +
|-
 +
| 4 || ? || Identical to VEN
 +
|-
 +
| 5 || ? || Identical to VEN
 +
|-
 +
| 6 || AttachFinish || Identical to VEN
 +
|-
 +
| 7 || SetAlternateSetting || Not available in HID
 +
|-
 +
| 8 || ? || Does not exist in HID
 +
|-
 +
| 0x10 || SuspendResume || Identical to VEN
 +
|-
 +
| 0x11 || CancelEndpoint (?) || ?
 +
|-
 +
| 0x12 (ioctlv) || CtrlTransfer (?) || ?
 +
|-
 +
| 0x13 (ioctlv) || IntrTransfer (?) || ?
 +
|-
 +
| 0x14 (ioctlv) || IsoTransfer || Not available in HID
 +
|-
 +
| 0x15 (ioctlv) || BulkTransfer || Not available in HID
 
|}
 
|}
  
 
[[Category:IOS API documentation]]
 
[[Category:IOS API documentation]]

Revision as of 14:36, 28 October 2017

/dev/usb/hid is used to interact with USB HIDs in IOS57, 58 and 59.

It is very similar to /dev/usb/ven and other v5 interfaces. Some ioctl handlers are identical to USB_VEN. Both rely on /dev/usb/usb for most actions.

Handles

Handles for USB_HID function exactly the same as for USB_VEN.

Ioctls

Ioctl Name Notes
0 GetVersion Identical to VEN
1 GetDeviceChange Identical to VEN
2 Shutdown Identical to VEN
3 GetDeviceInfo (?) ?
4 ? Identical to VEN
5 ? Identical to VEN
6 AttachFinish Identical to VEN
7 SetAlternateSetting Not available in HID
8 ? Does not exist in HID
0x10 SuspendResume Identical to VEN
0x11 CancelEndpoint (?) ?
0x12 (ioctlv) CtrlTransfer (?) ?
0x13 (ioctlv) IntrTransfer (?) ?
0x14 (ioctlv) IsoTransfer Not available in HID
0x15 (ioctlv) BulkTransfer Not available in HID