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

How to get all of the BLE connection state?

Aside from the connection interval, I'd like to know if the 2Mhz phy is enable along with Data Packet Length Extension and Connection Event Length Extension.

Is there a way for the app to get this information?  

  • Hi,

    I'd like to know if the 2Mhz phy

    When the PHY is updated you will get a event, BLE_GAP_EVT_PHY_UPDATE, with the PHY that is used. See this and this link.

    along with Data Packet Length Extension

    This is handled by the GATT Module. You can read it with the function nrf_ble_gatt_data_length_get().

    and Connection Event Length Extension.

    This is something that is either enabled or disabled. When enabled the SoftDevice will dynamically extend the connection event when possible.

    If sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &opt) returned NRF_SUCCESS, it's enabled. You cannot use sd_ble_opt_get for this option. See this link. Snippet on how to enable:

        ret_code_t err_code;
        ble_opt_t  opt;
    
        memset(&opt, 0x00, sizeof(opt));
        opt.common_opt.conn_evt_ext.enable = 1;
    
        err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &opt);
        APP_ERROR_CHECK(err_code);

Related