nRF Connect SDK API 2.8.0
Loading...
Searching...
No Matches
scan.h File Reference
#include <zephyr/types.h>
#include <zephyr/sys/slist.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/conn.h>

Go to the source code of this file.

Data Structures

struct  bt_scan_filter_info
 Filter information structure. More...
 
struct  bt_filter_status
 Filter status structure. More...
 
struct  bt_scan_adv_info
 Advertising info structure. More...
 
struct  bt_scan_short_name
 A helper structure to set filters for the name. More...
 
struct  bt_scan_manufacturer_data
 A helper structure to set filters for the manufacturer data. More...
 
struct  bt_scan_init_param
 Structure for Scanning Module initialization. More...
 
struct  bt_scan_name_filter_status
 Name filter status structure, used to inform the application which name filter is matched. More...
 
struct  bt_scan_addr_filter_status
 Address filter status structure, used to inform the application which address filter is matched. More...
 
struct  bt_scan_uuid_filter_status
 UUID filter status structure, used to inform the application which UUID filters are matched. More...
 
struct  bt_scan_appearance_filter_status
 Appearance filter status structure, used to inform the application which appearance filter is matched. More...
 
struct  bt_scan_manufacturer_data_filter_status
 Manufacturer data filter status structure, used to inform the application which manufacturer data filter is matched. More...
 
struct  bt_scan_filter_match
 Structure for setting the filter status. More...
 
struct  bt_scan_device_info
 Structure containing device data needed to establish connection and advertising information. More...
 
struct  cb_data
 Data for scanning callback structure. More...
 
struct  bt_scan_cb
 Scanning callback structure. More...
 

Macros

#define BT_SCAN_NAME_FILTER   0x01
 Filters the device name.
 
#define BT_SCAN_ADDR_FILTER   0x02
 Filters the device address.
 
#define BT_SCAN_UUID_FILTER   0x04
 Filters the UUID.
 
#define BT_SCAN_APPEARANCE_FILTER   0x08
 Filters the appearance.
 
#define BT_SCAN_SHORT_NAME_FILTER   0x10
 Filters the device short name.
 
#define BT_SCAN_MANUFACTURER_DATA_FILTER   0x20
 Filters the manufacturer data.
 
#define BT_SCAN_ALL_FILTER   0x3F
 Uses the combination of all filters.
 
#define BT_SCAN_CB_INIT(_name, match_fun, no_match_fun, error_fun, connecting_fun)
 Initializing macro for scanning module.
 

Enumerations

enum  bt_scan_type { BT_SCAN_TYPE_SCAN_PASSIVE , BT_SCAN_TYPE_SCAN_ACTIVE }
 Scan types. More...
 
enum  bt_scan_filter_type {
  BT_SCAN_FILTER_TYPE_NAME , BT_SCAN_FILTER_TYPE_SHORT_NAME , BT_SCAN_FILTER_TYPE_ADDR , BT_SCAN_FILTER_TYPE_UUID ,
  BT_SCAN_FILTER_TYPE_APPEARANCE , BT_SCAN_FILTER_TYPE_MANUFACTURER_DATA
}
 Types of filters. More...
 

Functions

void bt_scan_cb_register (struct bt_scan_cb *cb)
 Register scanning callbacks.
 
void bt_scan_init (const struct bt_scan_init_param *init)
 Function for initializing the Scanning Module.
 
int bt_scan_start (enum bt_scan_type scan_type)
 Function for starting scanning.
 
int bt_scan_stop (void)
 Function for stopping scanning.
 
void bt_scan_update_init_conn_params (struct bt_le_conn_param *new_conn_param)
 Function to update initial connection parameters.
 
int bt_scan_filter_enable (uint8_t mode, bool match_all)
 Function for enabling filtering.
 
void bt_scan_filter_disable (void)
 Function for disabling filtering.
 
int bt_scan_filter_status_get (struct bt_filter_status *status)
 Function for getting filter status.
 
int bt_scan_filter_add (enum bt_scan_filter_type type, const void *data)
 Function for adding any type of filter to the scanning.
 
void bt_scan_filter_remove_all (void)
 Function for removing all set filters.
 
int bt_scan_params_set (struct bt_le_scan_param *scan_param)
 Function for changing the scanning parameters.
 
void bt_scan_conn_attempts_filter_clear (void)
 Clear connection attempts filter.
 
int bt_scan_blocklist_device_add (const bt_addr_le_t *addr)
 Add a new device to the blocklist.
 
void bt_scan_blocklist_clear (void)
 Clear the blocklist of the scanning module device.
 
void bt_scan_update_connect_if_match (bool connect_if_match)
 Function to update the autoconnect flag after a filter match.