简体   繁体   English

NRF51-iOS BLE广告间隔-提高连接速度

[英]NRF51 - iOS BLE advertising interval - Increase speed of connection

I am looking at speeding up the connection time between my iOS application and the peripheral. 我正在考虑加快我的iOS应用程序与外围设备之间的连接时间。 I have looked up Apples Documentation on the subject: https://developer.apple.com/library/content/qa/qa1931/_index.html 我查阅了有关此主题的Apple文档: https : //developer.apple.com/library/content/qa/qa1931/_index.html

Originally (prior to reading the doc above) I had the advertising interval set to 2 seconds to, what I had thought would be, a good compromise between power consumption and connection time. 最初(在阅读上述文档之前),我曾将广告间隔设置为2秒,以至于我想是在功耗和连接时间之间做出了很好的折衷。 Having read the documentation further I have changed the interval to 1285 ms . 进一步阅读文档后,我将间隔更改为1285 ms #define ADVERTISING_INTERVAL 2056 ble_obj.setAdvertisingInterval(ADVERTISING_INTERVAL); #define ADVERTISING_INTERVAL 2056 ble_obj.setAdvertisingInterval(ADVERTISING_INTERVAL); The device is always discovered quickly by the app but the problem comes when trying to connect. 应用程序总是可以快速发现设备,但是尝试连接时会出现问题。

However, I have seen no increase in speed in connection time between my application and the peripheral device. 但是,我发现应用程序和外围设备之间的连接时间没有增加。 Connections between the devices can take anything from 3-4 seconds up to 30+ seconds. 设备之间的连接可能需要3-4秒到30+秒的时间。

Is there something I am missing? 我有什么想念的吗? Either on the peripheral or the central side? 在外围还是在中央?

Peripheral BT chip is the Nordic Semiconductor NRF51822. 外围BT芯片是Nordic Semiconductor NRF51822。 On examining the devices advertisement packet on the Nordic Semiconductor app I can see that the advertisement interval normally varies from 1275 ms to about 1295 ms (as expected? due to the random time added to the advertisement packet) 通过在Nordic Semiconductor应用程序上检查设备广告包,我可以看到广告间隔通常从1275毫秒变化到大约1295毫秒(正如预期的那样,由于添加到广告包中的随机时间)

NOTE Have also tried with an advertising interval of 152.5 ms and am still not seeing any major improvement in connection speed. 注意还尝试了152.5 ms的广告间隔,但仍看不到连接速度有任何重大改善。 I am , obviously, seeing a marked improvement in speed of discovery 很明显,我发现发现速度有了显着提高

What you observe is normal. 您观察到的是正常现象。 Don't expect fast connection setup with an advertising interval of more than a second. 不要期望广告间隔超过一秒的快速连接设置。

Core Bluetooth uses a high duty scan window/interval for the initiation the first seconds. 在最初的几秒钟内,Core Bluetooth使用高占空比扫描窗口/间隔进行初始化。 If it doesn't connect then it continues to scan with much more power restrictive parameters. 如果未连接,则它将继续使用更多功率限制参数进行扫描。

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

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