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

Android disconnect issues

I am using HRM demo application on nRF52840 DK with Samsung Tab-A. The nRF Connect App is running on the tablet. We are seeing that the dev kit gets disconnected soon after a connection is established. The error code on peripheral side is 0x2A.

Android version is 7.0 Device model number SM-T580 Bluetooth version 4.2

This does not happen on iPhone 7 with the nRFConnect app.

Also, this does not happen on LG Nexus 5 smartphone running Bluetooth version 4.0.

  • Thanks for the suggestion. This still did not fix the issue. I added the following lines of code which is executed once on power up (outside while(1) loop).

    ble_stack_init();
    peer_manager_init();
    gap_params_init();
    gatt_init();
    advertising_data_set();
    
    // initiliaze BLE parameters
    gatt_mtu_set(ble_params.att_mtu);
    data_len_ext_set(ble_params.data_len_ext_enabled);
    conn_evt_len_ext_set(ble_params.conn_evt_len_ext_enabled);
    preferred_phy_set(&ble_params.phys);
    
    //st compatibility mode to 2 for samsung Tab-A disconnect issues
    ret_code_t err_code;
    ble_opt_t  opt;       
    memset(&opt, 0x00, sizeof(opt));
    opt.gap_opt.compat_mode_2.enable = 1;
    err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_2 , &opt);
    APP_ERROR_CHECK(err_code);
    

    When I use the sd_ble_opt_get to read back the option (just to confirm) this soft device API returns error code 7 (invalid param). not sure what is wrong with this code below:

     memset(&opt, 0x00, sizeof(opt));
    err_code = sd_ble_opt_get(BLE_GAP_OPT_COMPAT_MODE_2 , &opt);
    APP_ERROR_CHECK(err_code);
    NRF_LOG_INFO("compatiblity get:%d", opt.gap_opt.compat_mode_2.enable);
    

    Also, I noticed that in the latest soft device v6 release notes that this issue has been fixed (DRGN-8623). Is that correct?

  • Could you try to use our sniffer ? What you provided is Android log. It doesn't provide all the information needed. I saw some connection established but then saw "Sent Disconnect" meaning it's disconnected by the phone.

    In last softdevice, it's fixed by allowing the parallel LL link command for all LL commands (except 2 same LL commands) by default. So the compatible mode 2 is not needed. Note that compatible mode 2 only cover part of the LL commands, so there could be a chance that your central issue wasn't covered by Compat mode 2.

    sd_ble_opt_get(BLE_GAP_OPT_COMPAT_MODE_2) always return code 7 , it's a bug and since this mode is deprecated in newer softdevice, we won't fix it.

Related