This group includes scanning APIs.
Functions | |
at_ble_status_t | at_ble_scan_start (uint16_t interval, uint16_t window, uint16_t timeout, at_ble_scan_type_t type, at_ble_scan_mode_t mode, bool filter_whitelist, bool filter_dublicates) |
Start scan operation. More... | |
at_ble_status_t | at_ble_scan_stop (void) |
Stops an ongoing scan operation. More... | |
at_ble_status_t at_ble_scan_start | ( | uint16_t | interval, |
uint16_t | window, | ||
uint16_t | timeout, | ||
at_ble_scan_type_t | type, | ||
at_ble_scan_mode_t | mode, | ||
bool | filter_whitelist, | ||
bool | filter_dublicates | ||
) |
Start scan operation.
While the scan operation is ongoing, the application will always receive AT_BLE_SCAN_INFO event per found device.
In case of using AT_BLE_SCAN_GEN_DISCOVERY or AT_BLE_SCAN_LIM_DISCOVERY, also AT_BLE_SCAN_REPORT event will be received at the end of scan process or error occurred when trying to start scanning procedure
[in] | interval | Scan interval in 625us units, a value between AT_BLE_ADV_INTERVAL_MIN and AT_BLE_ADV_INTERVAL_MAX |
[in] | window | Scan window in 625us units, value between AT_BLE_SCAN_WINDOW_MIN and AT_BLE_SCAN_INTERVAL_MAX |
[in] | timeout | Scan time-out, between 0x0001 and 0x028F in scale of Seconds, 0x0000 disables time-out. |
[in] | type | Controls the type of scan to perform either Passive or Active at_ble_scan_type_t for more details. |
[in] | mode | Either General, Limited or Observer only, at_ble_scan_mode_t for more details |
[in] | filter_whitelist | If true, get scan results only from white-listed devices added by at_ble_whitelist_add otherwise scan results will be got from any advertising device. This filter should not be used with AT_BLE_ADV_GEN_DISCOVERABLE and AT_BLE_ADV_LIM_DISCOVERABLE modes ONLY. |
[in] | filter_dublicates | If true, scan event will be generated only once per device, if false multiple events will be issued |
While the scan operation is ongoing, the application will always receive AT_BLE_SCAN_INFO event per found device.
In case of using AT_BLE_SCAN_GEN_DISCOVERY or AT_BLE_SCAN_LIM_DISCOVERY, also AT_BLE_SCAN_REPORT event will be received at the end of scan process.
[in] | interval | Scan interval in 625us units |
[in] | window | Scan window in 625us units |
[in] | timeout | Scan time-out, 0x0000 disables time-out. |
[in] | type | Controls the type of scan to perform either Passive or Active at_ble_scan_type_t for more details. |
[in] | mode | Either General, Limited or Observer only, at_ble_scan_mode_t for more details |
[in] | filter_whitelist | If true, get scan results only from white-listed devices added by at_ble_whitelist_add otherwise scan results will be got from any advertising device. |
[in] | filter_duplicates | If true, scan event will be generated only once per device. If false, multiple events per device may be generated. Note that if more than 10 devices are found, filtering only applies to the first 10 found; multiple scan events may be generated for 11th and subsequent devices. |
References at_ble_addr_t::addr, device_info::addr_auto_gen, at_ble_addr_get(), AT_BLE_INVALID_PARAM, AT_BLE_SCAN_ACTIVE, AT_BLE_SCAN_INTERVAL_MAX, AT_BLE_SCAN_INTERVAL_MIN, AT_BLE_SCAN_OBSERVER_MODE, AT_BLE_SCAN_PASSIVE, AT_BLE_SCAN_WINDOW_MAX, AT_BLE_SCAN_WINDOW_MIN, AT_BLE_SUCCESS, device, gapm_get_device_address_type(), GAPM_SCAN_ACTIVE, gapm_start_scan_cmd_handler(), device_info::renew_dur, SCAN_PASSIVE, status, and at_ble_addr_t::type.
at_ble_status_t at_ble_scan_stop | ( | void | ) |
Stops an ongoing scan operation.
References gapm_cancel_cmd_handler().