[UWP] [C#]在后台从BLE设备收集数据 [英] [UWP][C#]Collect data from BLE device in background

查看:109
本文介绍了[UWP] [C#]在后台从BLE设备收集数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写专有的UWP应用程序,它连接到我们的BLE设备并从中收集数据。该应用程序不公开,将在Windows 10工业平板电脑上运行。数据收集过程对用户来说非常关键。

I'm coding proprietary UWP app which connects to our BLE device and collects data from it. The app isn't be public and will run on Windows 10 industrial tablet. The data collection process is very critical for the user.

即使我的应用程序不在前台,有没有办法收集数据?是否有可能在一台Windows 10设备上无限期地从5个不同的BLE设备收集数据,而不会有后台任务以某种方式被操作系统终止的风险?

Is there a way to collect data even when my application isn't in foreground? Is it possible to collect data from 5 different BLE devices indefinitely on one Windows 10 device without risking the background task to be somehow terminated by OS?

推荐答案

嗨Marin Dusek,

Hi Marin Dusek,

>>即使我的应用程序不在前台,有没有办法收集数据?

>>Is there a way to collect data even when my application isn't in foreground?

是的,有。您应该能够使用后台任务来收集数据。

Yes, there is. You should able to use background task to collect data.

>>是否可以在一台Windows 10设备上无限期地从5个不同的BLE设备收集数据冒着操作系统以某种方式终止后台任务的风险?

>>Is it possible to collect data from 5 different BLE devices indefinitely on one Windows 10 device without risking the background task to be somehow terminated by OS?

是的,似乎有可能。对于长时间运行的后台任务,有三个触发器:MaintenanceTrigger,ApplicationTrigger和DeviceUseTrigger。您应该能够使用这些触发器触发后台触发器。

Yes, it seems it is possible. For long-running background tasks, there are three triggers: MaintenanceTrigger, ApplicationTrigger and DeviceUseTrigger. You should able to use these trigger to fire the background trigger.

有关于后台任务指南的官方文档,请在此链接中查看:  https://msdn.microsoft.com/en-us/windows/uwp/launch -resume / guidelines-for-background-tasks

There is an official document about Guidelines for background tasks, please refer it in this link: https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/guidelines-for-background-tasks.

最好的问候,

Jayden Gu

Jayden Gu


这篇关于[UWP] [C#]在后台从BLE设备收集数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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