Making a Windows Mobile device emulate a Bluetooth HID device

后端 未结 1 769
无人及你
无人及你 2021-01-01 07:19

I\'m looking for a way to connect a Windows Mobile device to a PC via Bluetooth and have it show up on the PC as a HID device (i.e. Keyboard or Mouse). I imagine this would

相关标签:
1条回答
  • 2021-01-01 07:46

    It's perfectly possible. Just start a bluetooth server registered with the HID service Guid {00001124-0000-1000-8000-00805f9b34fb}. If the device supports the Microsoft bluetooth stack you can use Peter Foot's excellent .NET CF library (http://32feet.net/) and BluetoothService.HumanInterfaceDevice;

    UPDATE:

    With Peter Foot's library the server would look something like this:

    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
            }
        }
    }
    

    Regards, tamberg

    0 讨论(0)
提交回复
热议问题