Is there a way to disconnect from devices that have exceeded the maximum number of connections allowed?

Is there a way to disconnect from devices that have exceeded the maximum number of connections allowed?

I am developing with nrf52832 (s132 v7.0.1, SDK v17.0.0) as a peripheral device.

The s132 can connect up to 20 devices.
I currently have "NRF_SDH_BLE_PERIPHERAL_LINK_COUNT" set to 8 and "NRF_SDH_BLE_CENTRAL_LINK_COUNT" set to 0.

If you create a situation where you are connected to 8 central devices with nRF Connect and try to connect with a 9th device, the 9th device will disconnect after a while.

Is this 9th device sending a connection request but disconnecting due to timeout?
Also, is it possible to disconnect immediately when the ninth unit tries to connect?

Thank you in advance.

Parents
  • Hi,

    I would suggest to handle this before the issue occurs. If you only support 8 connections, then it does not make sense to use connectable advertising when you already have 8 connections. So I suggest only advertise connectable with up to 7 connections, and either don't advertise or advertise non-connectable when you have 8 connections (depending on what makes sense for your use case).

  • Hello.

    I try to stop adverting when I am able to connect with 8 units. Therefore, it should not be possible to connect with the 9th device.
    However, if I do a Scan with nRF Connect, I can connect to the device that has previously advertised to me.
    Can I disconnect from the 9th device that I am trying to connect to from nRF Connect at this time?

    Thank you in advance.

  • Hi,

    sdi_kei said:
    However, if I do a Scan with nRF Connect, I can connect to the device that has previously advertised to me.

    No, that is not possible. However, the  GUI may make it seem like it is possible as you can select to connect, and then it will wait for the peripheral to advertise so that it can connect (a connection can only be established in a short time window immediately following an advertising packet). If it does not, it will block until it times out. Note that the way connections are established is defined by the Bluetooth specification, and it is simply not possible to connect to a device that is not currently advertising.

    sdi_kei said:
    Can I disconnect from the 9th device that I am trying to connect to from nRF Connect at this time?

    There is nothing you can do on the peripheral to change this behavior, as it resides entirely in the central. There is no connection active in the case you described, it is just that the central is waiting for the opportunity to connect. You can verify that no connection is initiated by checking with a sniffer.

  • Hello.

    I was just looking at the GUI and it looked like it was possible to connect, but in reality it is not possible to connect without receiving an advertisement.

    Thank you very much. It helped me a lot.

Reply Children
No Data
Related