如何在C#应用程序内部连接WiiMote?

时间:2012-01-19 18:07:07

标签: c# bluetooth wiimote

我想使用WiiMoteLib将单个wiiMote连接到我的应用程序,但我想在内部完成连接,即。用户只需要运行应用程序(并且不需要将wiiMote与windows向导或bluesoleil连接)。该应用程序使用C#,语言无法更改。 谢谢!

2 个答案:

答案 0 :(得分:0)

32feet.NET能做到这一点吗?

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

可能还需要处理配对,可能使用BluetoothWin32Authentication并处理其回调,请参阅http://32feet.codeplex.com/wikipage?title=Bluetooth%20Securityhttp://32feet.codeplex.com/wikipage?title=BluetoothWin32Authentication

答案 1 :(得分:0)

这里有一个如何使用Microsoft蓝牙API和HID API执行此操作的示例:

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

它很有效。

它在C ++中,但很容易转换为C#。