OS X 10.11 El Capitan上的蓝牙低功耗延迟/延迟 [英] Bluetooth Low Energy Lag / Latency on OS X 10.11 El Capitan

查看:59
本文介绍了OS X 10.11 El Capitan上的蓝牙低功耗延迟/延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发Mac OS X应用程序,该应用程序通过低功耗蓝牙持续向硬件设备发送命令.在优胜美地的支持下,该应用程序运行良好,命令传输的往返延迟为7-12毫秒.该命令将以最少2秒和最多0.2秒的稳定间隔发送到自定义BLE服务.

I've been developing a Mac OS X application that sends commands continuously over Bluetooth Low Energy to a hardware device. Under Yosemite, the app worked well, with a measured roundtrip latency of 7-12 ms for a command transmission. The command is sent to a custom BLE service in a steady interval of minimum 2 seconds and maximum 0.2 seconds.

现在,最近几个月我一直没有开发(该应用尚未发布),然后升级到El Capitan,现在该应用的延迟时间为 500-1500毫秒>,这使整个操作变得绝对无法使用.我假设是升级到El Capitan的原因,但是我不确定.

Now, I haven't been developing in the last months (the app isn't live yet), then upgraded to El Capitan, and now the same app has a latency of 500-1500 ms, which renders the whole thing absolutely unusable. I am assuming the upgrade to El Capitan is the cause, but I cannot know for sure.

我检查了什么

  • 我在运行El Capitan的多台MacBook Pro上进行了测试,并且延迟总是那么糟糕.
  • 这些命令无论发送到什么服务(例如设备信息服务),都具有很高的延迟,并且每发送一条消息,它的变化就很大.
  • 我使用自己的应用程序,名为"LightBlue"的第三方应用程序发送十六进制字符串都没关系,还是苹果自己的蓝牙资源管理器"开发人员工具(可以在Developer Resources中下载).
  • li>

有人能提示我这可能是什么原因,或者只是告诉我在他们的环境中一切正常吗?要进行复制,请使用Mac连接到任何支持Bluetooth Low Energy的设备,然后向其发送十六进制数据串.您必须以某种方式对其进行记录,或者打开一个LED左右,以查看是否存在明显的延迟.

Can anyone hint me to what could cause this, or maybe just tell me that in their environment it all works fine? To reproduce, connect to any Bluetooth Low Energy capable device with your Mac, and send a hex string of data to it. You'd have to log it somehow or turn on an LED or so, to see if there is significant latency.

任何帮助将不胜感激!

推荐答案

最后,Apple DTS帮助我解决了这个问题.他们向我提示了固件中错误设置的首选连接参数".

In the end Apple DTS helped me solve the problem. They hinted me at the "preferred connection parameters" that were set incorrectly in my firmware.

在优胜美地的早期版本中,这些值没有影响(与iOS相同),但是由于某些操作系统更新,它们在优胜美地和El Capitan上读取.完全不设置参数就解决了问题.

On earlier versions of Yosemite, those values had no effect (same as on iOS), but since some OS update they are read on Yosemite and El Capitan. Not setting the parameters at all solved the problem.

就我而言,这些值是默认设置的:

In my case, the values were set by default:

连接间隔:至少7.5ms,最长50ms

Connection interval: minimum 7.5ms, maximum 50ms

从属延迟:0毫秒

连接监控超时:10000

这些值以某种方式导致了高延迟.这是我必须在Cypress PSoC Creator 3.3中取消设置的屏幕截图(我正在使用PSoC 4 BLE).

These values somehow caused the high latency. Here's a screenshot of the settings I had to untick inside the Cypress PSoC Creator 3.3 (I'm using a PSoC 4 BLE).

这篇关于OS X 10.11 El Capitan上的蓝牙低功耗延迟/延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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