Function bt_le_scan_start

Source
pub unsafe extern "C" fn bt_le_scan_start(
    param: *const bt_le_scan_param,
    cb: bt_le_scan_cb_t,
) -> c_int
Expand description

@brief Start (LE) scanning

Start LE scanning with given parameters and provide results through the specified callback.

@note The LE scanner by default does not use the Identity Address of the local device when @kconfig{CONFIG_BT_PRIVACY} is disabled. This is to prevent the active scanner from disclosing the identity address information when requesting additional information from advertisers. In order to enable directed advertiser reports then @kconfig{CONFIG_BT_SCAN_WITH_IDENTITY} must be enabled.

@note Setting the param.timeout parameter is not supported when @kconfig{CONFIG_BT_PRIVACY} is enabled, when the param.type is @ref BT_LE_SCAN_TYPE_ACTIVE. Supplying a non-zero timeout will result in an -EINVAL error code.

@param param Scan parameters. @param cb Callback to notify scan results. May be NULL if callback registration through @ref bt_le_scan_cb_register is preferred.

@return Zero on success or error code otherwise, positive in case of protocol error or negative (POSIX) in case of stack internal error. @retval -EBUSY if the scanner is already being started in a different thread.