简体   繁体   English

通用Windows 10应用程序在连接到配对的BLE设备时显示确认

[英]Universal Windows 10 App shows confirmation when connecting to paired BLE device

I have a quick question - I'm writing a PoC app using Universal Windows 10 SDK (C#) and when I'm trying to connect to a previously paired BLE (Bluetooth Low Energy) device, I get a confirmation screen like this: 我有一个快速的问题-我正在使用Universal Windows 10 SDK(C#)编写PoC应用程序,当我尝试连接到先前配对的BLE(蓝牙低能耗)设备时,会看到如下确认屏幕:

在此处输入图片说明

If I'm pressing on "Yes" everything is OK but I'm thinking what will happen if I will deploy this app to an IoT device that runs Windows 10 Core IoT. 如果我按“是”,则一切正常,但是我在考虑如果将此应用程序部署到运行Windows 10 Core IoT的IoT设备会发生什么。 Is there any way to specify something in the app manifest in order to not show this screen anymore? 有什么方法可以在应用清单中指定某些内容,以便不再显示此屏幕?

The code that leads to this is the following: 导致这种情况的代码如下:

BluetoothLEDevice bleDevice = null;

try
{
  bleDevice = await BluetoothLEDevice.FromBluetoothAddressAsync(this.bluetoothDeviceAddress.Value);
  }
  catch (Exception exception)
  {
    lbBLEAddress.Text = exception.ToString();
    return;
   }

Thank you very much. 非常感谢你。

This sounds very similar to an issue I encountered when attempting to read the heart rate sensor from a Microsoft Band using an RPi 2 running Windows IoT Core. 这听起来非常类似于我尝试使用运行Windows IoT Core的RPi 2从Microsoft Band读取心率传感器时遇到的问题。

I discovered that although the Band SDK worked with Windows IoT Core, there was limited functionality with regard to certain sensors which require user interaction through consent prompts. 我发现,尽管Band SDK与Windows IoT核心版配合使用,但是某些传感器的功能有限,需要用户通过同意提示进行交互。

At this time, it seems that the IoT Core does not contain the necessary libraries to create the popup dialog that is seen on other devices when executing this method. 这时,IoT Core似乎不包含创建执行此方法时在其他设备上看到的弹出对话框的必需库。 This post details and documents Windows.UI.Popups.MessageDialog as currently unsupported and is likely the root of your issue. 这篇文章详细介绍了Windows.UI.Popups.MessageDialog并将其记录为当前不受支持的文档,很可能是问题的根源。

-Paul 保罗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM