LayrzBlePluginStub class

Inheritance

Constructors

LayrzBlePluginStub.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
onEvent Stream<BleEvent>
onEvent is a stream of BLE events.
no setteroverride
onNotify Stream<BleCharacteristicNotification>
onNotify is a stream of BLE notifications. To add a new notification listener, use startNotify method. This stream will emit the raw bytes of the notification.
no setteroverride
onScan Stream<BleDevice>
onScan is a stream of BLE devices detected during a scan.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkCapabilities() Future<BleCapabilities>
checkCapabilities checks if the device supports BLE.
override
connect({required String macAddress}) Future<bool?>
connect connects to a BLE device.
override
disconnect() Future<bool?>
disconnect disconnects from any connected BLE device.
override
discoverServices({Duration timeout = const Duration(seconds: 30)}) Future<List<BleService>?>
discoverServices discovers the services of a BLE device.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readCharacteristic({required String serviceUuid, required String characteristicUuid, Duration timeout = const Duration(seconds: 30)}) Future<Uint8List?>
readCharacteristic reads the value of a BLE characteristic. The return value is the raw bytes of the characteristic.
override
setMtu({required int newMtu}) Future<int?>
setMtu sets the MTU size for the BLE connection. The MTU size is the maximum number of bytes that can be sent in a single packet, also, MTU means Maximum Transmission Unit and it is the maximum size of a packet that can be sent in a single transmission.
override
startNotify({required String serviceUuid, required String characteristicUuid}) Future<bool?>
startNotify starts listening to notifications from a BLE characteristic. To stop listening, use stopNotify method and to get the notifications, use onNotify stream.
override
startScan({String? macAddress, List<String>? servicesUuids}) Future<bool?>
startScan starts scanning for BLE devices.
override
stopNotify({required String serviceUuid, required String characteristicUuid}) Future<bool?>
stopNotify stops listening to notifications from a BLE characteristic.
override
stopScan() Future<bool?>
stopScan stops scanning for BLE devices.
override
toString() String
A string representation of this object.
inherited
writeCharacteristic({required String serviceUuid, required String characteristicUuid, required Uint8List payload, Duration timeout = const Duration(seconds: 30), required bool withResponse}) Future<bool>
writeCharacteristic sends a payload to a BLE characteristic.
override

Operators

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

Static Methods

registerWith() → void