module bluerpc_client.scanner
Bluetooth scanner for BlueRPC.
class BlueRPCBLEScanner
Scanner for BlueRPC BLE devices.
method __init__
__init__(
client,
on_advertisement,
on_disconnect=None,
services: 'List[str]' = [],
reconnect=True
) → None
Create the scanner
Args:
client
: a BlueRPC client instance (must be already connected to start the scanner)on_advertisement
: a callback function taking one argument of type BlueRPCBLEAdvertisement, will be called on each new advertisementon_disconnect
: a callback function called when the scanner is disconnectedservices
: a list of service uuid to filter onreconnect
: if the scanner should try to reconnect if the connection is lost (must also be enabled for the client)
method start
start(active=True, interval=2000) → bool
Start the scanner
Args:
active
: if we need to use active scaninterval
: scan interval in miliseconds
method stop
stop()
Stop the scanner
class BlueRPCBLEAdvertisement
BlueRPCBLEAdvertisement(resp: 'gatt_pb2.BLEScanResponseData')
method __init__
__init__(resp: 'BLEScanResponseData')
This file was automatically generated via lazydocs.