Function nrf_softdevice_s122::sd_ble_enable
source · pub unsafe fn sd_ble_enable(p_app_ram_base: *mut u32) -> u32
Expand description
@brief Enable the BLE stack
@param[in, out] p_app_ram_base Pointer to a variable containing the start address of the application RAM region (APP_RAM_BASE). On return, this will contain the minimum start address of the application RAM region required by the SoftDevice for this configuration. @warning After this call, the SoftDevice may generate several events. The list of events provided below require the application to initiate a SoftDevice API call. The corresponding API call is referenced in the event documentation. If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop communicating with the peer device. - @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST - @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST - @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST - @ref BLE_GAP_EVT_SEC_REQUEST - @ref BLE_GAP_EVT_AUTH_KEY_REQUEST - @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST - @ref BLE_EVT_USER_MEM_REQUEST
@note The memory requirement for a specific configuration will not increase between SoftDevices with the same major version number.
@note At runtime the IC’s RAM is split into 2 regions: The SoftDevice RAM region is located between 0x20000000 and APP_RAM_BASE-1 and the application’s RAM region is located between APP_RAM_BASE and the start of the call stack.
@details This call initializes the BLE stack, no BLE related function other than @ref sd_ble_cfg_set can be called before this one.
@mscs @mmsc{@ref BLE_COMMON_ENABLE} @endmscs
@retval ::NRF_SUCCESS The BLE stack has been initialized successfully. @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized and cannot be reinitialized. @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. @retval ::NRF_ERROR_NO_MEM One or more of the following is true: - The amount of memory assigned to the SoftDevice by *p_app_ram_base is not large enough to fit this configuration’s memory requirement. Check *p_app_ram_base and set the start address of the application RAM region accordingly. - Dynamic part of the SoftDevice RAM region is larger then 64 kB which is currently not supported. @retval ::NRF_ERROR_RESOURCES The total number of L2CAP Channels configured using @ref sd_ble_cfg_set is too large.