Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Scanning Procedure APIs

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

Parameters
[in]intervalScan interval in 625us units, a value between AT_BLE_ADV_INTERVAL_MIN and AT_BLE_ADV_INTERVAL_MAX
[in]windowScan window in 625us units, value between AT_BLE_SCAN_WINDOW_MIN and AT_BLE_SCAN_INTERVAL_MAX
[in]timeoutScan time-out, between 0x0001 and 0x028F in scale of Seconds, 0x0000 disables time-out.
[in]typeControls the type of scan to perform either Passive or Active at_ble_scan_type_t for more details.
[in]modeEither General, Limited or Observer only, at_ble_scan_mode_t for more details
[in]filter_whitelistIf 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_dublicatesIf true, scan event will be generated only once per device, if false multiple events will be issued
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by app_init(), ble_l2cap_disconnected(), and gap_dev_scan().

at_ble_status_t at_ble_scan_stop ( void  )

Stops an ongoing scan operation.

Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by ble_observer_custom_event(), ble_scan_info(), ble_scan_info_handler(), ble_scan_report_app_event(), pxp_monitor_scan_data_handler(), and pxp_monitor_start_scan().