Scanner – scan for nearby BLE devices

Allows scanning for nearby BLE devices.

Usage:

import bleio
scanner = bleio.Scanner()
entries = scanner.scan(2500)
print(entries)
class bleio.Scanner

Create a new Scanner object.

interval

The interval (in ms) between the start of two consecutive scan windows. Allowed values are between 10ms and 10.24 sec.

window

The duration (in ms) in which a single BLE channel is scanned. Allowed values are between 10ms and 10.24 sec.

scan(timeout)

Performs a BLE scan.

Parameters:timeout (int) – the scan timeout in ms
Returns:advertising packets found
Return type:list of bleio.ScanEntry