module bluerpc.ble_scan
class BLEScanner
This class is used to scan for Bluetooth Low-Energy devices and store the results as ready-to-send proto objects
method __init__
__init__(adapter) → None
method check_filters
check_filters(device: BLEDevice) → bool
Check Filters
Args:
device
: bleak device
Returns: True if the device matches at least one of the filters (defined in the scan method) or that there is no filters
method detection_callback
detection_callback(
device: BLEDevice,
advertisement_data: AdvertisementData
) → None
Detection callback
Called from the Bleak Scanner for each device discovered Applies the remaining filters, creates the proto objects and adds them to the queues
Args:
device
: bleak deviceadvertisement_data
: bleak advertisement data
method restart_scan
restart_scan() → None
Restart the scanner
Useful to restart the scanner after it was temporarily stopped to connect to a device
method scan
scan(active: bool, interval: int, filters: List[BLEScanFilter]) → None
Start scanner method
Args:
active
: if the scanner should be in active or passive modeinterval
: interval to send messagesfilters
: list of filters to apply for scanning, services uuid are processed directly by bleak, others are post-processed
method stop_scan
stop_scan() → None
Stop scanner method
Stops the scanner if not already stopped
This file was automatically generated via lazydocs.