简体   繁体   English

Swift - 在 iOS 后台模式下执行 BLE 命令

[英]Swift - BLE command execution in Background mode in iOS

I want to continuously communicate with BLE device in in one of the my iOS application.我想在我的 iOS 应用程序之一中与 BLE 设备持续通信。 Is it possible?是否可以?

How can i achieve this?我怎样才能做到这一点?

Thanks,谢谢,

Not sure what do you mean by Background mode.不知道你说的后台模式是什么意思。 Do you mean when the app is minimized or do you mean in background thread?您是说应用程序最小化时还是在后台线程中?

As far as being continuously connected with the BLE device is concerned then yes it is possible!就与 BLE 设备的持续连接而言,是的,这是可能的! Provided your BLE device is continuously powered on and available.前提是您的 BLE 设备持续通电且可用。

You'd have to search for particular service and then its characteristics using Core Bluetooth.您必须使用 Core Bluetooth 搜索特定服务,然后搜索其特征。

Mind you this could be a battery draining operation.请注意,这可能是电池耗尽操作。

Suggestion would be to connect read what you want to read and disconnect.建议是连接阅读您想要阅读的内容并断开连接。

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

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