Line 5:
Line 5:
The VID/PID of the internal dongle is 57e/305.
The VID/PID of the internal dongle is 57e/305.
−
ios_open("/dev/usb/oh1/57e/305"); //open the internal bluetooth dongle
+
<source lang="c">ios_open("/dev/usb/oh1/57e/305"); //open the internal bluetooth dongle</source>
== Requests ==
== Requests ==
=== Send Control Request ===
=== Send Control Request ===
−
ioctlv(fd, '''0''', 6, 1, vectors);
+
<source lang="c">ioctlv(fd, '''0''', 6, 1, vectors);</source>
Vectors:
Vectors:
Line 65:
Line 65:
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). The operation returns the number of bytes read or written. Vectors are an array of the following structure:
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). The operation returns the number of bytes read or written. Vectors are an array of the following structure:
+
<source lang="c">
typedef struct _ioctlv
typedef struct _ioctlv
{
{
Line 72:
Line 73:
u32 len;
u32 len;
} ioctlv;
} ioctlv;
+
</source>
=== Send Or Receive Bulk/Interrupt Message ===
=== Send Or Receive Bulk/Interrupt Message ===
−
ioctlv(fd, '''1''', 2, 1, vectors); //Bulk
+
<source lang="c">
−
ioctlv(fd, '''2''', 2, 1, vectors); //Interrupt
+
ioctlv(fd, '''1''', 2, 1, vectors); //Bulk
+
ioctlv(fd, '''2''', 2, 1, vectors); //Interrupt
+
</source>
Vectors:
Vectors:
Line 113:
Line 117:
Here is an example code which resets the internal bluetooth dongle and breaks the connection to the wiimote. To compile it, you need devkitPro/devkitPPC and libogc with WII support.
Here is an example code which resets the internal bluetooth dongle and breaks the connection to the wiimote. To compile it, you need devkitPro/devkitPPC and libogc with WII support.
−
<pre>
+
<source lang="c">
#include <stdio.h>
#include <stdio.h>
#include <stdint.h>
#include <stdint.h>
Line 283:
Line 287:
return 0;
return 0;
−
}</pre>
+
}</source>