使用GattCharacteristicNotificationTrigger在UWP中挂起后台任务注册 [英] Background task registration hangs in UWP with GattCharacteristicNotificationTrigger

查看:73
本文介绍了使用GattCharacteristicNotificationTrigger在UWP中挂起后台任务注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用进程内后台任务来获取Bluetooth LE设备的通知.但是,以下代码挂在最后一行,不会返回:

I'm trying to use an in-process background task to get notifications of a Bluetooth LE device. However, the following code hangs at the last line and does not return:

var bldr = new BackgroundTaskBuilder();
bldr.Name = guid.ToString("N");
var trigger = new GattCharacteristicNotificationTrigger(ch);
bldr.SetTrigger(trigger);
bldr.Register();

在应用程序中使用基于事件的模型时,获取设备的通知是可行的.同样,使用TimeTrigger注册任务也可以,因此在应用清单中的声明是可以的.

Getting the notifications of the device works when using the event-based model in the application. Also, registering the task with a TimeTrigger works, so the declaration in the app manifest is ok.

计算机运行创建者更新",但UWP设置为至少需要周年纪念"更新.

The computer runs the Creators Update, but the UWP is set to require the Anniversary update as a minimum.

推荐答案

我们在Windows 10移动版上的UWP应用遇到了同样的问题.在我们将Windows 10移动版更新为内部版本10.0.15230.0后,此问题已得到解决.

We've had the same issue with UWP app on windows 10 mobile. It was resolved after we had updated windows 10 mobile to build 10.0.15230.0.

这篇关于使用GattCharacteristicNotificationTrigger在UWP中挂起后台任务注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆