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

BLE connection problem

Hi,

I'm using sdk12.3.0 ble_app_uart.

My problem is BLE connection.

Sometimes(almost 50%)I tried to connect BLE but fail and I have to connect again.

I don't know why.

This image is messages that I captured when connection failed.

What is the problem?

Thank you for reading my question!

image description

Parents
  • Hi,

    Did you go into Bluetooth settings on your phone, and removed the device form the list of paired/bonded the devices? Also try to restart the phone.

    On the nRF51, you could try to enable the Service Changed characteristic so that changes in the application are indicated to the phone. Set IS_SRVC_CHANGED_CHARACT_PRESENT to 1.

    Code snippet(SDK12.3):

    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    
    ble_enable_params_t ble_enable_params;
    err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
                                                    PERIPHERAL_LINK_COUNT,
                                                    &ble_enable_params);
    APP_ERROR_CHECK(err_code);
    
    ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
    
Reply
  • Hi,

    Did you go into Bluetooth settings on your phone, and removed the device form the list of paired/bonded the devices? Also try to restart the phone.

    On the nRF51, you could try to enable the Service Changed characteristic so that changes in the application are indicated to the phone. Set IS_SRVC_CHANGED_CHARACT_PRESENT to 1.

    Code snippet(SDK12.3):

    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    
    ble_enable_params_t ble_enable_params;
    err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
                                                    PERIPHERAL_LINK_COUNT,
                                                    &ble_enable_params);
    APP_ERROR_CHECK(err_code);
    
    ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
    
Children
No Data
Related