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

what's the function of the paramter BLE_L2CAP_MTU_DEF?

hello, the function ble_stack_init () in the example of ble_app_uart are quite different from that in the example of ble_app_proximity in my first sight. ble_app_uart :


static void ble_stack_init(void)
{
    // YOUR_JOB: If the MTU size is changed by the application, the MTU_SIZE parameter to
    //           BLE_STACK_HANDLER_INIT() must be changed accordingly.
    BLE_STACK_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM,
                           BLE_L2CAP_MTU_DEF,
                           ble_evt_dispatch,
                           false);
}

ble_app_proximity :


static void ble_stack_init(void)
{
    uint32_t err_code;
    
    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false);

    // Register with the SoftDevice handler module for BLE events.
    err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
    APP_ERROR_CHECK(err_code);
    
    // Register with the SoftDevice handler module for BLE events.
    err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
    APP_ERROR_CHECK(err_code);
}

after comparison, I find the parameter BLE_L2CAP_MTU_DEF may be the point. I get confused the function of the parameter,thought it says Default L2CAP MTU.

what will happen if I change the value of the parameter?

Related