BLEAdapter.authenticate waits for the gap_evt_sec_params_request event with timeout=10s.
It does not handle a disconnected event during this time, but will keep waiting for the full 10 seconds.
A somewhat common case for this is if authentication is done immediately after the connected event, but the central is still in the "connected, not proven" state, because the peripheral has missed the connection request. This leads to a disconnected event with reason=conn_failed_to_be_established, arriving within ~150ms (depending on connection interval). The BLEAdapter then blocks for the 10s.
Maybe the EvtSync class could be extended to allow waiting for multiple events.
BLEAdapter.authenticate waits for the gap_evt_sec_params_request event with timeout=10s.
It does not handle a disconnected event during this time, but will keep waiting for the full 10 seconds.
A somewhat common case for this is if authentication is done immediately after the connected event, but the central is still in the "connected, not proven" state, because the peripheral has missed the connection request. This leads to a disconnected event with reason=conn_failed_to_be_established, arriving within ~150ms (depending on connection interval). The BLEAdapter then blocks for the 10s.
Maybe the EvtSync class could be extended to allow waiting for multiple events.