Bluetooth Host Stack Library
Bluetooth Stack Initialization & Configuration

General Description

This section describes API and Data structures required to initialize and configure the BTSTACK and various submodules.

Functions

int32_t wiced_bt_stack_get_dynamic_memory_size_for_config (const wiced_bt_cfg_settings_t *p_bt_cfg_settings)
 Returns the expected dynamic memory size required for the stack based on the p_bt_cfg_settings. More...
 
wiced_result_t wiced_bt_stack_init (wiced_bt_management_cback_t *p_bt_management_cback, const wiced_bt_cfg_settings_t *p_bt_cfg_settings)
 This API initializes the stack based on the configuration in p_bt_cfg_settings and allocates memory as per the configuration. More...
 
wiced_result_t wiced_bt_stack_deinit (void)
 This is a blocking call (returns after all de-initialization procedures are complete) It is recommended that the application disconnect any outstanding connections prior to invoking this function. More...
 
wiced_result_t wiced_bt_smp_module_init (void)
 Initialize SMP(Security Manager). More...
 
wiced_result_t wiced_bt_init_resolution (void)
 This API enables the Host based address resolution. More...
 

Function Documentation

◆ wiced_bt_init_resolution()

wiced_result_t wiced_bt_init_resolution ( void  )

This API enables the Host based address resolution.

If Host based resolution is enabled then advertisment packet with Resolvable private address is resolved by host.

Note
This should be invoked in the BTM_ENABLED_EVT event.
Returns
wiced_result_t
WICED_BT_SUCCESS : If successful
WICED_NO_MEMORY : If no memory/buffers available to create the Resolving list

◆ wiced_bt_smp_module_init()

wiced_result_t wiced_bt_smp_module_init ( void  )

Initialize SMP(Security Manager).

This API enables the Security Manager module in the stack to accept incoming pairing requests

Note
calling any SMP API in the application without calling wiced_bt_smp_module_init will result in error or undefined behavior.
Returns
wiced_result_t
WICED_BT_SUCCESS : If successful
WICED_BT_ERROR : If an error occurred

◆ wiced_bt_stack_deinit()

wiced_result_t wiced_bt_stack_deinit ( void  )

This is a blocking call (returns after all de-initialization procedures are complete) It is recommended that the application disconnect any outstanding connections prior to invoking this function.

Returns
WICED_BT_SUCCESS : On success;
WICED_BT_ERROR : If an error occurred

◆ wiced_bt_stack_get_dynamic_memory_size_for_config()

int32_t wiced_bt_stack_get_dynamic_memory_size_for_config ( const wiced_bt_cfg_settings_t p_bt_cfg_settings)

Returns the expected dynamic memory size required for the stack based on the p_bt_cfg_settings.

Parameters
[in]p_bt_cfg_settings: Bluetooth stack configuration
Returns
Dynamic memory size requirements of the stack

◆ wiced_bt_stack_init()

wiced_result_t wiced_bt_stack_init ( wiced_bt_management_cback_t p_bt_management_cback,
const wiced_bt_cfg_settings_t p_bt_cfg_settings 
)

This API initializes the stack based on the configuration in p_bt_cfg_settings and allocates memory as per the configuration.

It also initializes platform interfaces and the controller. It registers the application callback for notification of Bluetooth events issues by the stack. Upon successfully Initialization of Bluetooth controller and stack, application receives BTM_ENABLED_EVT with the event data in wiced_bt_dev_enabled_t.

Warning
Controller FW (patch) download is the part of wiced_bt_stack_init , if wiced_bt_stack_platform_t::pf_patch_download fails, application may not receive BTM_ENABLED_EVT.
Parameters
[in]p_bt_management_cback: Callback for receiving Bluetooth management events(wiced_bt_management_evt_e)
[in]p_bt_cfg_settings: Bluetooth stack configuration wiced_bt_cfg_settings_t
Returns
WICED_BT_SUCCESS : On success
WICED_ERROR : If an error occurred
Note
This API must be implemented by platform porting layer.
This API must be called before using any Bluetooth functionality.
If p_bt_cfg_settings is null, stack uses default parameters defined in wiced_bt_cfg.h
However, it is strongly recommended that applications define the configuration to appropriate values based on the application use case.