This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unexpected disconnection (reason 22)

Platform: NRF52832, s132_nrf52_6.0.0, SDK 15.0
Remote: iPad (12.1.4) with proprietary APP
Use-Case: APP (Central) connects to Platform and reads continuesly data via RX-TX-characteristics (~1 kBytes\s)
Problem: Always after ~4 hours the Platform terminates the connection "gap_evt.params.disconnected.reason = 22"

From the Air-Trace I can see following at the end (unsure if the trace is reliable):
---
MASTER LLCP Channel Map Indication (Used: 0-9,11-14,16,19,21-36 / Unused: 10,15,17-18,20, Inst=25'235 (+399) | 14.532.478 154 625 (+11.970 s))
MASTER LLCP Channel Map Indication (Used: 0-9,11-14,16,19,21-32,34-36 / Unused: 10,15,17-18,20,33, Inst=25'502 (+398) | 14.540.488 335 375 (+11.940 s))
MASTER LLCP Channel Map Indication (Used: 0-9,11-14,16-19,22-32,34-36 / Unused: 10,15,20-21,33, Inst=25'769 (+398) | 14.548.498 514 250 (+11.940 s))
SLAVE LLCP Reject Extended Indication (Connection Update Indication, Page Timeout)
SLAVE LLCP Ping
SLAVE LLCP Termination (Unacceptable Connection Parameters)
---

Best Regards
Stefanos

  • Hi Edvin,
     
    I found my bug : "gap_params_init" must be called before "conn_params_init" (I compared the working SDK-example with my project).
    "gap_params_init" configures the default softdevice parameters (0xFFFF) by calling "sd_ble_gap_ppcp_set".
    The module "ble_conn_params.c" uses the default softdevice parameters when I call "conn_params_init".

    Thank you for the information about the suitable connection interval for highest datathoughput.

    Best Regards
    Stefan

  • Edvin wrote: 

    You can check the disconnect reason in the BLE_GAP_EVT_DISCONNECTED event by reading the p_ble_evt->evt.gap_evt.disconnected.reason.

    There's a missing "params" to refer to the union. The correct syntax is:

    p_ble_evt->evt.gap_evt.params.disconnected.reason

Related