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

S110 Disconnects when in connection with S120

I have a peripheral based on S110 that is connected to by a central running S120.

The connection is established, the S120 interrogates the service and enables notification on the correct characteristic. At this time, the peripheral isn't actually generating any notifications. Connection events occur every 100ms and empty data PDUs are exchanged.

After about a minute, the peripheral terminates the connection with an LL_TERMINATE_IND link layer control message.

If I examine the disconnect notification event from the SD I see that the disconnection reason is 0x16 (Local host Disconnected).

I don't see this termination behaviour when the peripheral is connected to the nrf master control panel on Android, so presumably I need to do somthing on the S120 to ensure this doesn't happen, but I need to understand why the disconnect is occuring first.

Any ideas what's causing the S110 to disconnect, I can't see anything in the code examples that suggest there's a timeout on the connection?

disconnect_1.pcapng.txt

Parents
  • Hi Pål ,

    Thanks for your response. You seem to be right about it being related to connection parameter renegotiation, if I change my min & max connection parameters on the peripheral to be within the range initially established when the S120 connects then the link stays active.

    Can you explain this further though. Is this timeout in the soft device itself? In the peripheral code (which is based on the HRS example) the connection parameter's disconnect_on_fail parameter is set false, and I have confirmed with the debugger that neither of the calls to sd_ble_gap_disconnect() [in update_timeout_handler/ble_conn_params.c or on_conn_params_evt/main.c] are being called.

    Thanks for again for your help and insight.

    Phil.

    
    static void conn_params_init(void)
    {
        uint32_t               err_code;
        ble_conn_params_init_t cp_init;
    
        memset(&cp_init, 0, sizeof(cp_init));
    
        cp_init.p_conn_params                  = NULL;
        cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
        cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
        cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
        cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
        **cp_init.disconnect_on_fail             = false;**
        cp_init.evt_handler                    = on_conn_params_evt;
        cp_init.error_handler                  = conn_params_error_handler;
    
        err_code = ble_conn_params_init(&cp_init);
        APP_ERROR_CHECK(err_code);
    }
    
Reply
  • Hi Pål ,

    Thanks for your response. You seem to be right about it being related to connection parameter renegotiation, if I change my min & max connection parameters on the peripheral to be within the range initially established when the S120 connects then the link stays active.

    Can you explain this further though. Is this timeout in the soft device itself? In the peripheral code (which is based on the HRS example) the connection parameter's disconnect_on_fail parameter is set false, and I have confirmed with the debugger that neither of the calls to sd_ble_gap_disconnect() [in update_timeout_handler/ble_conn_params.c or on_conn_params_evt/main.c] are being called.

    Thanks for again for your help and insight.

    Phil.

    
    static void conn_params_init(void)
    {
        uint32_t               err_code;
        ble_conn_params_init_t cp_init;
    
        memset(&cp_init, 0, sizeof(cp_init));
    
        cp_init.p_conn_params                  = NULL;
        cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
        cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
        cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
        cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
        **cp_init.disconnect_on_fail             = false;**
        cp_init.evt_handler                    = on_conn_params_evt;
        cp_init.error_handler                  = conn_params_error_handler;
    
        err_code = ble_conn_params_init(&cp_init);
        APP_ERROR_CHECK(err_code);
    }
    
Children
Related