zephyr::raw

Function bt_enable

source
pub unsafe extern "C" fn bt_enable(
    cb: Option<unsafe extern "C" fn(_: i32)>,
) -> i32
Expand description

@brief Enable Bluetooth

Enable Bluetooth. Must be the called before any calls that require communication with the local Bluetooth hardware.

When @kconfig{CONFIG_BT_SETTINGS} is enabled, the application must load the Bluetooth settings after this API call successfully completes before Bluetooth APIs can be used. Loading the settings before calling this function is insufficient. Bluetooth settings can be loaded with settings_load() or settings_load_subtree() with argument “bt”. The latter selectively loads only Bluetooth settings and is recommended if settings_load() has been called earlier.

@param cb Callback to notify completion or NULL to perform the enabling synchronously. The callback is called from the system workqueue.

@return Zero on success or (negative) error code otherwise.