10 Replies Latest reply on Jan 28, 2020 3:46 AM by PY_21

    Remove oldest bonding cannot connect more than 4 devices




      I cannot connect to more than 4 devices by using CyBle_GapRemoveOldestDevice. When the fifth BLE central tries to connect, the device reject the connection by returning "CYBLE_HCI_CONNECTION_TERMINATED_LOCAL_HOST_ERROR" in disconnect event.


      This problem only occur occasionally, I tested on serval devices and only 1 of them has this issue. For the others, I repeat the testing many time but they can connect to more than 4 devices. And after I reprogram the device, sometimes it can connect to more than 5 devices but sometimes do not.


      After calling  "CyBle_GapRemoveOldestDevice", I then call "CyBle_StoreBondingData" to update the bonding list in flash.

      However, I put the "CyBLe_GapRemoveOldestDevice" in event "CYBLE_EVT_GAP_AUTH_REQ", would it be the reason that the device rejects connection and returns "CYBLE_HCI_CONNECTION_TERMINATED_LOCAL_HOST_ERROR"?