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

Why MTU over 147 bytes prevents connection with iPhone 7?

Hi

We are developing ble peripheral application for the nrf52832 using SDK v13.0.0. and everything was working correctly until we tried ble connection with the iphone 7 with ios 11.1.2. iPhone 6 with the same ios version was working correctly.

I found out that the mtu value higher than 147 was the reason why we we're unable to connect but this did'nt happen when the mtu value was equal or lower than 147. If the value was higher than 147 we we're able to find the device, we just could'nt connect.

// Configure the maximum ATT MTU.
memset(&ble_cfg, 0x00, sizeof(ble_cfg));
ble_cfg.conn_cfg.conn_cfg_tag                 = CONN_CFG_TAG;
ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = NRF_BLE_GATT_MAX_MTU_SIZE; // 147
err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &ble_cfg, ram_start);
APP_ERROR_CHECK(err_code);

// Configure the maximum event length.
memset(&ble_cfg, 0x00, sizeof(ble_cfg));
ble_cfg.conn_cfg.conn_cfg_tag                     = CONN_CFG_TAG;
ble_cfg.conn_cfg.params.gap_conn_cfg.event_length = BLE_GAP_EVENT_LENGTH_DEFAULT;
ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count   = BLE_GAP_CONN_COUNT_DEFAULT;
err_code = sd_ble_cfg_set(BLE_CONN_CFG_GAP, &ble_cfg, ram_start);
APP_ERROR_CHECK(err_code);

What might be the cause for this and what are the factors that i need to take under consideration when setting the mtu?

Niko

Related