[英]Skipping confirmation popup or overriding for Bluetooth Device pair in windows from UWP app?
While connecting to any Bluetooth device, a yes/no popup appears from windows.连接到任何蓝牙设备时,会出现来自 windows 的是/否弹出窗口。
From app, is there any way to programmatically skip this yes/no popup?从应用程序中,有没有办法以编程方式跳过这个是/否弹出窗口?
Checked few documentation.检查了一些文档。
If you just want to connect to a Bluetooth device and it is a BLE device, you could take a look at this document BluetoothLE GATT client .如果你只想连接到一个蓝牙设备并且它是一个 BLE 设备,你可以看看这个文档BluetoothLE GATT client 。
As the sample code here:作为此处的示例代码:
DeviceWatcher deviceWatcher =
DeviceInformation.CreateWatcher(
BluetoothLEDevice.GetDeviceSelectorFromPairingState(false),
requestedProperties,
DeviceInformationKind.AssociationEndpoint);
You could see that the DeviceWatcher
could emulate BLE devices that are not even paired.您可以看到
DeviceWatcher
可以模拟甚至没有配对的 BLE 设备。 Then you could call BluetoothLEDevice.FromIdAsync
to create a BluetoothLEDevice device.然后您可以调用
BluetoothLEDevice.FromIdAsync
来创建 BluetoothLEDevice 设备。
BluetoothLEDevice bluetoothLeDevice = await BluetoothLEDevice.FromIdAsync(deviceInfo.Id);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.