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

the extension of MTU length

Hi,

My development environment is sdk12.3 s132_3.0 pca10040

I want to increase the MTU size to 64 bytes in nus.
I programmed as below, but there is no MTU size change.
It is not called with gatt_event_handler ().

/**@brief Function for handling events from the GATT library. */
void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t * p_evt)
{
NRF_LOG_DEBUG("ATT MTU exchange completed. central 0x%x peripheral 0x%x",
p_gatt->att_mtu_desired_central,
p_gatt->att_mtu_desired_periph);
}


/**@brief Function for initializing the GATT library. */
void gatt_init(void)
{
ret_code_t err_code = nrf_ble_gatt_init(&m_gatt, gatt_evt_handler);
APP_ERROR_CHECK(err_code);

err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt, 100);
APP_ERROR_CHECK(err_code);
}

int main(void)
{
ret_code_t err_code;
bool erase_bonds;

leds_init();

err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);

gpios_init();
ble_stack_init();

uart_init();
peer_manager_init(erase_bonds);

db_discovery_init();
lbs_c_init();


gatt_init();
gap_params_init();
conn_params_init();

services_init();
advertising_init();

=== omit below ====

}

Please, reply
Parents Reply Children
No Data
Related