BluetoothModule class

Module for high-performance Bluetooth Low Energy (BLE) management.

Constructors

BluetoothModule()

Properties

hashCode int
The hash code for this object.
no setterinherited
isScanning bool
Returns true if a BLE scan is currently active.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanStream Stream<BleDevice>
A stream of BleDevice objects discovered during a scan.
no setter

Methods

connect(String id, {bool autoReconnect = true}) Future<bool>
Attempts to connect to a specific BLE device by its id.
disconnect(String id) Future<bool>
Disconnects from the BLE device with the given id.
discoverServices(String deviceId) Future<List<String>>
Discovers GATT services for a connected device.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openL2capStream(String deviceId, int psm) Stream<Uint8List>
Opens a raw binary socket directly to a BLE device over L2CAP. Returns a stream of Uint8List bytes.
readData(String deviceId, String serviceId, String charId) Future<Uint8List?>
Reads raw byte data from a specific GATT characteristic.
sendData(String deviceId, String serviceId, String charId, List<int> data) Future<bool>
Sends raw byte data to a specific GATT characteristic.
startScan() Future<bool>
Starts scanning for nearby BLE devices. Discovered devices are delivered via the scanStream.
startScanWithOptions(BluetoothScanOptions options, {bool autoRequestPermission = true}) Future<bool>
Starts scanning with granular native Bluetooth scanning options.
stopScan() Future<bool>
Stops the active BLE scan.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited