How to connect the WiiMote internally in a C# app?

985 views Asked by At

I want to connect a single wiiMote to my app using WiiMoteLib, but I want the connection done internally ie. the user has only to run the app (and should have no need to connect the wiiMote with windows wizard or bluesoleil). The app is in C# and the language cannot be changed. Thanks!

2

There are 2 answers

0
alanjmcf On

Does 32feet.NET do the job?

BluetoothAddress addr = ... address from discovery or known address...
var dev = new BluetoothDeviceInfo(addr);
dev.SetServiceState(BluetoothService.HumanInterfaceDevice, true); // this line!

You may also need to handle pairing, perhaps using BluetoothWin32Authentication and handling its callback, see http://32feet.codeplex.com/wikipage?title=Bluetooth%20Security and http://32feet.codeplex.com/wikipage?title=BluetoothWin32Authentication

0
Aaron Murgatroyd On

There is an example of how to do this here using the Microsoft Bluetooth API and the HID API:

http://www.richlynch.com/code/wiipair

It works quire well.

Its in C++, but its pretty easy to convert to C#.