Datasheet
information.
By default active scanning is disabled, so no Scan Response packets will be received by BLEScanner unless this
function is called and set to 1 before calling Bluefruit.Scanner.start(0) .
void filterRssi(int8_t min_rssi);
void filterMSD(uint16_t manuf_id);
void filterUuid(BLEUuid ble_uuid);
void filterUuid(BLEUuid ble_uuid1, BLEUuid ble_uuid2);
void filterUuid(BLEUuid ble_uuid1, BLEUuid ble_uuid2, BLEUuid ble_uuid3);
void filterUuid(BLEUuid ble_uuid1, BLEUuid ble_uuid2, BLEUuid ble_uuid3, BLEUuid
ble_uuid4);
void filterUuid(BLEUuid ble_uuid[], uint8_t count);
Filters can be applied to BLEScanner to narrow down the data sent to the callback handler, and make processing
advertising packets easier for you.
As of BSP 0.7.0 the following three filters are present:
filterRssi(int8_t min_rssi) : Filters advertising results to devices with at least the specified RSSI value, which allows
you to ignore devices that are too far away or whose signal is too weak. The higher the number, the strong the
signal so -90 is a very weak signal, and -60 is a much stronger one.
filterUuid(BLEUuid ble_uuid) : Filters advertising results to devices that advertise themselves as having the
specified service UUID. If multiple UUIDs are entered, they will be filtered with boolean OR logic, meaning any
single UUID present will be considered a match.
void filterMSD(uint16_t manuf_id) : Fitlers advertising results to devices that contain a Manufacturer Specific Data
data type, and who use the specifed Bluetooth Customer ID ( manuf_id) . This can be useful to filter iBeacon
versus Eddystone devices, for example, which both used the MSD field, or to look for custom MSD data matching
your own CID.
void clearFilters(void);
This function clears and filter values set using the functions above.
bool start(uint16_t timeout = 0);
bool stop(void);
The .start and .stop functions can be used to start and stop scanning, and should be called after all of the main
parameters (timing, filters, etc.) have been set.
The .start function has a single parameter called timeout, which sets the number of seconds to scan for advertising
packets. Setting this to '0' (the default value) will cause the device to scan forever.
When multiple UUIDs are added via one of the .filterUuid(...) functions, they UUIDs will be filtered using
boolean 'OR' logic, meaning that the callback will fire when ANY of the specified UUIDs are detected in the
advertising packet.
Make sure you set any filters of BLEScanner parameters before calling .start!
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 102 of 175