Android:同时BLE连接的限制 [英] Android: Limit of simultaneous BLE connections

查看:441
本文介绍了Android:同时BLE连接的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个Android应用,该应用可以通过低功耗蓝牙同时连接到多个心率传感器.

we are developing an Android app which can connect to multiple heart rate sensors simultaneoulsy via Bluetooth Low Energy.

我们有一个运行良好的实现,因此代码不是问题. 让我们抓狂的是并行BLE连接的局限性,这似乎因设备而异.

We have an implementation which is working quite well, so the code is not the problem. What drives us crazy is the limitation of parallel BLE-connections which seems to be different from device to device.

我们这里有一些测试设备:摩托罗拉MotoE和MotoG,三星Galaxy Tab A和HTC Nexus9.所有这些设备都运行Android 5或6,原始厂商版本.它们都无法同时连接到7个以上的BLE HR传感器.

We have a few test devices here: Motorola MotoE and MotoG, a Samsung Galaxy Tab A and an HTC Nexus 9. All of them are running Android 5 or 6, original vendor versions. None of them is able to connect to more than 7 BLE HR sensors simultaneously.

然后,我已经测试了我的私有Samsung Galaxy S4,它已植根并安装了Cyanogen CM12.使用此设备,我可以轻松地同时连接12个HR传感器,这是我们希望通过我们的应用实现的数量.

Then I have tested with my private Samsung Galaxy S4, which is rooted and has Cyanogen CM12 installed. With this device I can easily connect to 12 HR sensors simultaneously which is the number we want to achieve with our app.

我已经使用我们自己的应用程序实施和Nordic Semiconductor nRF主控制面板(我认为这是一个非常好的通用BLE应用程序)对此进行了测试:

I have tested this both with our own app implementation and with the Nordic Semiconductor nRF Master Control Panel which I think is a pretty good generic BLE app: https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=de

当我尝试将应用程序连接到我们任何设备上的第7个BLE传感器时,ADB输出都会输出以下错误消息: E/BluetoothLeBasicConn:连接状态更改错误:133

When I try to connect the app to a 7th BLE sensor on any of our devices, the ADB output prints the following error message: E/BluetoothLeBasicConn: Connection state changing error: 133

我对整个问题进行了一些深入的搜索,但是我发现的大多数结果都还很旧.有人说该限制来自蓝牙芯片组本身,而其他人则说这是通过Android进行的软件限制.

I did some pretty intensive googling about that whole problem, but most of the results I've found were quite old. Some people said, that the limitation came from the Bluetooth Chipset itself, others said it was a software limitation through Android.

您能帮我找出限制的来源吗?

Could you help me to find out, where the limitation is coming from?

如果是芯片组,那么我想知道,我们应该使用哪些设备来支持尽可能多的并行连接.可悲的是,很难找到不同设备中内置的蓝牙芯片组.我发现几乎没有任何硬件规格可以说明这一点.

If it is the chipset, then I would like to know, which devices we should use for supporting as many parallel connections as possible. Sadly it is very hard to find out which Bluetooth chipset is built in the different devices. Hardly any of the hardware specs I found tell anything about this.

如果限制来自软件方面,我们能否以某种方式更改它而无需生根手机或安装经过修改的操作系统?

If the limitation comes from software side, can we change it somehow without rooting phones or install modded OS?

非常感谢!

推荐答案

如果您仍然对此感兴趣.限制来自 BTA_GATTC_CONN_MAX(在Android中硬编码) 设置为:

In case that you are still interested in it. The limit comes from BTA_GATTC_CONN_MAX (hardcoded in android) Which is set to:

    在Android 4.3和
  • 4上
  • 在Android 4.4上为7
  • 4 on Android 4.3 and
  • 7 on Android 4.4

顺便说一句,您可以激活通知的特征数量也受到限制. (BTA_GATTC_NOTIF_REG_MAX) 这是:

There is by the way also a limit on the amount of characteristics for which you can activate notifications. (BTA_GATTC_NOTIF_REG_MAX) which is:

  • 在Android 4.3上为4,
  • 在Android 4.4和
  • 7上
  • 在Android 5.0上为15
  • 4 on Android 4.3,
  • 7 on Android 4.4 and
  • 15 on Android 5.0

这篇关于Android:同时BLE连接的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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