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

nRF52832 get current connection MTU size

Hi. After my nRF52832 peripheral connects to an android / iOS, I am trying to read the MTU size that has been negotiated with the following code;

/**@brief Function for handling events from the GATT library. */
void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
{
    current_mtu = p_evt->params.att_mtu_effective; //Get this info for personal band

    if ((m_conn_handle == p_evt->conn_handle) && (p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
    {
        m_ble_nus_max_data_len = p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
    }
}

current_mtu is being set as 27 after connecting.

However the android phone is reporting the MTU size as 247. Also we are able to send 240 byte NUS messages, so am pretty sure att_mtu_effective is not correct.

How do I read the current MTU?

Thanks

Phil

Parents Reply Children
No Data
Related