What is the max concurrent Ble connections android M+ can have

后端 未结 2 1609
無奈伤痛
無奈伤痛 2020-12-18 02:54

My app required to connect 9 Ble devices concurrently. In this article and any other resource it write that android 4.4+ can connect only to 7 devices. Is there anything new

2条回答
  •  悲哀的现实
    2020-12-18 03:49

    It seems that those constants are global limits, and not per app. I am linking to the source of the BT stack in Android. I wonder why those constants are as they are... seem random.

    #define GATT_MAX_PHY_CHANNEL 7

    https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/include/bt_target.h#1428

    #define BTA_GATTC_CONN_MAX GATT_MAX_PHY_CHANNEL

    https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/bta/gatt/bta_gattc_int.h#89

    tBTA_GATTC_CONN conn_track[BTA_GATTC_CONN_MAX];

    https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/bta/gatt/bta_gattc_int.h#424

    NOTE

    This is the official Android code. Up until Android 7.2 the vendors used to change that implementation a lot. The theory in Android 8 and above is that vendors should not modify it (not enough Android 8 devices on the field to see how this works in practice... at least at time of writing this reply).

提交回复
热议问题