簡體   English   中英

從 UWP 應用程序跳過確認彈出窗口或覆蓋 windows 中的藍牙設備對?

[英]Skipping confirmation popup or overriding for Bluetooth Device pair in windows from UWP app?

連接到任何藍牙設備時,會出現來自 windows 的是/否彈出窗口。

從應用程序中,有沒有辦法以編程方式跳過這個是/否彈出窗口?

檢查了一些文檔。

如果你只想連接到一個藍牙設備並且它是一個 BLE 設備,你可以看看這個文檔BluetoothLE GATT client

作為此處的示例代碼:

DeviceWatcher deviceWatcher =
        DeviceInformation.CreateWatcher(
                BluetoothLEDevice.GetDeviceSelectorFromPairingState(false),
                requestedProperties,
                DeviceInformationKind.AssociationEndpoint);

您可以看到DeviceWatcher可以模擬甚至沒有配對的 BLE 設備。 然后您可以調用BluetoothLEDevice.FromIdAsync來創建 BluetoothLEDevice 設備。

 BluetoothLEDevice bluetoothLeDevice = await BluetoothLEDevice.FromIdAsync(deviceInfo.Id);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM