An action block that scans for nearby Bluetooth devices.
The fiber will pause until a new scan has completed.
The arrays assigned to Device names,
Device addresses, Device advertisements
and Signal strengths are of equal length, sorted in signal strength order.
The names array will often contain null elements since a device may only broadcast its name when “discoverable”.
The advertisements array may contain dictionary elements with the “advertising” properties emitted by an Bluetooth LE device.
The signal strengths array may contain -Infinity elements if the RSSI is unavailable for the device.
Required for Low Energy scans while the screen is off on Android 14+, and Android 8.1+ on Samsung devices, otherwise the scan results will be empty. Filters expects an array of dictionaries where each entry is describing a “filter” of properties a device must have to be included in the results:
An "address" entry where the value is a text with the address of the device.
An "name" entry where the value is a text with the name of the device.
An "advertising" entry where the value is a dictionary with a key:
An "eddystone" entry representing an Eddystone
beacon where the value is a dictionary with either key:
"uid" where value is a text of the hexadecimal encoded Beacon ID of the UID beacon, 32 characters/16 bytes."url" where value is a text of the URL of the URL beacon.An "iBeacon" entry representing an iBeacon
where the value is a dictionary with any of keys:
"uuid" where value is a text of UUID for the beacon."major" where value is a major version number of the beacon."minor" where value is a minor version number of the beacon.An "manufacturerSpecific" key where the value is a dictionary with a key:
"companyId" where value is a company identifier
number of the manufacturer specific advertising, e.g. 0x004C for Apple, Inc.An "service" entry where the value is a text of UUID for the service advertising.
An "serviceData" entry where the value is a dictionary with a key:
"uuid" where value is text of UUID for the service data advertising,
e.g. 0000feaa-0000-1000-8000-00805f9b34fb for Google LLC.An "serviceSolicitation" entry where the value is a text of UUID for the service solicitation advertising.
A "uri" entry where the value is an text of URI. (Android 13+).
1 2 3 kind, only one per filter entry.
An "eddystone" entry representing an Eddystone
beacon where the value is a dictionary with keys:
"uid" where value is a text of the hexadecimal encoded Beacon ID of the UID beacon, 32 characters/16 bytes."url" where value is a text of the URL of the URL beacon."batteryVoltage" where value is a number with the battery voltage in mV of the TLM beacon."hardwareTemperature" where value is a number with the temperature in degrees Celsius of the TLM beacon."framesEmitted" where value is the number of advertisement frames of all types emitted by the TLM beacon since power-up or reboot."uptime" where value is the number of seconds since the TLM beacon powered-up or rebooted.An "iBeacon" entry representing an iBeacon where the value is a dictionary with keys:
"uuid" where value is text of UUID for the beacon."major" where value is a major version number of the beacon."minor" where value is a minor version number of the beacon.An "uri" entry where the value is an text of URI.
An "txPower" entry where the value is a number with the transmission signal strength in dBm of the beacon,
from either a Transmit power advertising, or another kind of advertising that includes a transmit power level property.
Note! This feature may require that the system Location setting is enabled on Android 6+.