# Bluetooth device scan

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 (iBeacon, Eddystone or URL) beacon. The signal strengths array may contain -Infinity elements if the RSSI is unavailable for the device.

- Discovery scans may only find devices in a “discoverable” state, i.e. awaiting pairing.
- Low energy scans may only find Bluetooth LE devices “beacons” advertising their presence.
- Active scans will initiate a new scan.
- Passive scans will await results of scans initiated by other apps, not initiating a new scan.

Note! This feature may require that the system Location setting is enabled on Android 6+.

## Input arguments

- Scan mode — mode of scanning, default is Active discovery.
- Device type — type of device, default is any.
- Paired devices — whether to only include paired devices.
- Connectable only — whether to only include devices advertising as connectable, only works for Low energy scans. (Android 8+)

## Output variables

- Device addresses — variable to assign an array of device addresses.
- Device names — variable to assign an array of device names.
- Device advertisements — variable to assign an array of advertisements, only available for Low-Energy mode.
- Signal strengths — variable to assign an array of signal strengths, in dBm.