C# 检测 Windows Phone 项目中蓝牙设备上的按钮按下情况

Joh*_*rtz 6 c# bluetooth

我有一个蓝牙手写笔设备。它上面有三个按钮:电源/通话、音量增大、音量减小。在与手写笔配对的 Windows Phone 上运行的 C# 项目中,如何检测何时按下其中一个按钮?

注意:我已经可以在代码中看到该设备:

BluetoothDevice currentDevice { get; set; }
string deviceName = "P1";
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
    foreach (DeviceInformation di in await DeviceInformation.FindAllAsync(BluetoothDevice.GetDeviceSelector()))
    {
        BluetoothDevice bdDevice = await BluetoothDevice.FromIdAsync(di.Id);
        if (bdDevice.Name == deviceName)
        {
            currentDevice = bdDevice;
            //OK, so now what do I do to listen for the button clicks???
        }
    }
}
Run Code Online (Sandbox Code Playgroud)