Datasheet
BLEScanner
The BLEScanner class is used in Central Mode, and facilitates scanning for BLE peripherals in range and parsing the
advertising data that is being sent out by the peripherals.
The BLEScanner class is normally accessed via the Bluefruit class (instantiated at startup), as shown below:
API
BLEScanner has the following public API:
The Bluefruit nRF52 Feather codebase is in an early BETA stage and is undergoing active development
based on customer feedback and testing. As such, the class documentation here is incomplete, and you
should consult the Github repo for the latest code and API developments: https://goo.gl/LdEx62
This documentation is based on BSP 0.7.0 and higher. Please make sure you have an up to date version
before using the code below.
/* Start Central Scanning
* - Enable auto scan if disconnected
* - Filter for devices with a min RSSI of -80 dBm
* - Interval = 100 ms, window = 50 ms
* - Use active scan (requests the optional scan response packet)
* - Start(0) = will scan forever since no timeout is given
*/
Bluefruit.Scanner.setRxCallback(scan_callback);
Bluefruit.Scanner.restartOnDisconnect(true);
Bluefruit.Scanner.filterRssi(-80); // Only invoke callback when RSSI >= -80 dBm
Bluefruit.Scanner.setInterval(160, 80); // in units of 0.625 ms
Bluefruit.Scanner.useActiveScan(true); // Request scan response data
Bluefruit.Scanner.start(0); // 0 = Don't stop scanning after n seconds
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 99 of 175