| View previous topic :: View next topic |
| Author |
Message |
Cliff
Joined: 29 Nov 2006 Posts: 3
Digg It |
Posted: Wed Nov 29, 2006 11:22 pm Post subject: OSX Wiimote Enabler |
|
|
I'm working on a virtual HID device driver that derives from IOHIDDevice, but at the moment it's a bit crashy due to L2CAP packets failing somewhat randomly. Here is a userland app that pairs with the device properly. You can look at the normal interrupt packets from the Wii Remote using Apple's Bluetooth PacketLogger.
RVL Enabler (Just press Search in the Device Discovery window and it will find and pair any Wii Remotes that are discoverable)
The secret sauce here is:
| Code: |
[wiiDevice openConnection];
[wiiDevice performSDPQuery:nil];
IOBluetoothL2CAPChannel* cchan;
if ([wiiDevice openL2CAPChannelSync:&cchan withPSM:17 delegate:self] == kIOReturnSuccess)
printf("Control Channel opened.\n");
IOBluetoothL2CAPChannel* ichan;
if ([wiiDevice openL2CAPChannelSync:&ichan withPSM:19 delegate:self] == kIOReturnSuccess)
printf("Interrupt Channel opened\n");
|
Then you can write with [cchan writeSync:buffer:length]
To read, implement - (void)l2capChannelData:(IOBluetoothL2CAPChannel*)l2capChannel data:(void *)dataPointer length:(size_t)dataLength;
Basically, I'm implementing Bluetooth HID myself on top of the L2CAP stack.
-Cliff |
|
| Back to top |
|
 |
volsung Site Admin
Joined: 26 Nov 2006 Posts: 24
Digg It |
Posted: Thu Nov 30, 2006 2:14 am Post subject: Wow! |
|
|
| Whoa, that is awesome! This will be a huge help to me as I have been having to do testing inside a Linux virtual machine on my MacBook so far. Not too bad, but still a hassle. |
|
| Back to top |
|
 |
abeisgreat

Joined: 20 Nov 2006 Posts: 107 Location: Hyrule
Digg It |
Posted: Thu Nov 30, 2006 4:22 am Post subject: |
|
|
Nice info _________________
 |
|
| Back to top |
|
 |
pufuwozu

Joined: 28 Nov 2006 Posts: 29 Location: Brisbane, Australia
Digg It |
Posted: Thu Nov 30, 2006 6:47 am Post subject: |
|
|
| abeisgreat wrote: | | Nice info |
Can you explain what it does or what it's for? |
|
| Back to top |
|
 |
DeadPixel Site Admin

Joined: 19 Nov 2006 Posts: 103 Location: France
Digg It |
Posted: Thu Nov 30, 2006 1:18 pm Post subject: |
|
|
| pufuwozu wrote: | | abeisgreat wrote: | | Nice info |
Can you explain what it does or what it's for? |
It's the same thing as the Linux driver, but for MacOS X. Nice info too, even if I can't test it (I don't have Bluetooth dongle and... don't have Wii) _________________ Sorry for bad english...
Official WiiLi supporter - Artwork creator - documentation writer |
|
| Back to top |
|
 |
volsung Site Admin
Joined: 26 Nov 2006 Posts: 24
Digg It |
Posted: Thu Nov 30, 2006 1:27 pm Post subject: |
|
|
| Right, specificially at this stage, the OS X application is like the hidp/hidd combination on Linux. It finds a controller that is currently in discoverable mode (hit both 1+2 at same time) and opens two bluetooth connections, as required by the HID standard. |
|
| Back to top |
|
 |
werthog
Joined: 01 Dec 2006 Posts: 1
Digg It |
Posted: Fri Dec 01, 2006 4:37 pm Post subject: |
|
|
| Should the program you've posted here actually enable the Wiimote as an HID device? I use a program called ControllerMate (http://www.orderedbytes.com/controllermate/), which allows you to reprogram input devices; for example, I've set up my Guitar Hero controller to work in GarageBand, and I've reprogrammed my PS2 controller to work better with some flight simulators. Every controller, mouse, keyboard, etc. I've ever plugged in shows up in ControllerMate, but when I connect the Wiimote using the program you've posted, I don't see anything. Does this program only enable the Wiimote for programs specifically written for it, or am I doing something wrong? |
|
| Back to top |
|
 |
|