使Windows Mobile设备模拟蓝牙HID设备

时间:2008-11-11 14:50:01

标签: windows-mobile hid

我正在寻找一种通过蓝牙将Windows Mobile设备连接到PC的方法,并将其作为HID设备(即键盘或鼠标)显示在PC上。我想这主要是修改Windows Mobile设备上可用的蓝牙配置文件,以便它暴露蓝牙HID接口......这甚至可能吗?它需要一个自定义驱动程序或WinMo设备上的东西?在大多数情况下,我的主要要求是它不需要PC端的任何特殊软件,它应该只使用内置蓝牙堆栈并认为WinMo设备实际上是HID设备而不是PDA。

我的WinMo设备具有条形码扫描功能,因此我希望能够使用PDA将条形码扫描到PC,使用该HID界面。

另外,我主要使用C ++和C#,所以如果可以用其中一种语言来完成,那就最好了。

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

这是完全可能的。只需启动一个使用HID服务Guid {00001124-0000-1000-8000-00805f9b34fb}注册的蓝牙服务器。如果设备支持Microsoft蓝牙堆栈,您可以使用Peter Foot优秀的.NET CF库(http://32feet.net/)和BluetoothService.HumanInterfaceDevice;

更新:

使用Peter Foot的库,服务器看起来像这样:

using System.IO;
using InTheHand.Net.Sockets;
using InTheHand.Net.Bluetooth;

// ...

BluetoothListener l = new BluetoothListener(
    BluetoothService.HumanInterfaceDevice);
using (l) {
    BluetoothClient c = l.AcceptBluetoothClient();
    using (c) {
        Stream s = c.GetStream();
        using (s) {
            // send HID bytes
        }
    }
}

此致 tamberg