/dev/usb/oh1

< /dev‎ | usb
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

/dev/usb/oh1 is the device tree that handles requests to the internal USB bus (and possibly the external ports - need to check). This bus is connected to the Bluetooth dongle. This service exports a high-level interface similar to that of other userspace USB interfaces like libusb.

Opening

The device name is of the form /dev/usb/oh1/VID/PID, where VID and PID are the Vendor ID and Product ID of the device that is to be opened, in hexadecimal, with no leading zeroes. There is no known method of addressing individual identical device with the same VID/PID.

The VID/PID of the internal dongle is 57e/305.

ios_open("/dev/usb/oh1/57e/305"); //open the internal bluetooth dongle

Requests

Send Control Request

ioctlv(fd, 0, 6, 1, vectors);

Vectors:

I/IO Number Type Length Description
I 0 u8 1 bmRequestType
I 1 u8 1 bmRequest
I 2 u16 2 wValue (little-endian)
I 3 u16 2 wIndex (little-endian)
I 4 u16 2 wLength (same as length of vector 6, but little-endian)
I 5 u8 1 unknown; set to zero.
IO 6 array wLength request data payload

For example, to reset the Bluetooth HCI (and therefore break the connection with the Wiimote), send a message with the parameters (0x20,0,0,0,0x0300,0) and data 03 0C 00. (0x0300 is the length, 3, in little-endian format).