nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ bt_mgmt_scan_start()

int bt_mgmt_scan_start ( uint16_t  scan_intvl,
uint16_t  scan_win,
enum bt_mgmt_scan_type  type,
char const *const  name,
uint32_t  brdcast_id 
)

Start scanning for advertisements.

Parameters
[in]scan_intvlScan interval in units of 0.625ms. Valid range: 0x4 - 0xFFFF; can be 0.
[in]scan_winScan window in units of 0.625ms. Valid range: 0x4 - 0xFFFF; can be 0.
[in]typeType to scan for: ACL connection or broadcaster.
[in]nameName to search for. Depending on type of search, device name or broadcast name. Can be max BLE_SEARCH_NAME_MAX_LEN long; everything beyond that value will be cropped. Can be NULL. Shall be '\0' terminated.
[in]brdcast_idBroadcast ID to search for. Only valid if type is BT_MGMT_SCAN_TYPE_BROADCAST. If both name and brdcast_id are provided, then brdcast_id will be used. Set to BRDCAST_ID_NOT_USED if not in use.
Note
To restart scanning, call this function with all 0s and NULL, except for type. The same scanning parameters as when bt_mgmt_scan_start was last called will then be used.
Returns
0 if success, error otherwise.