MethodChannelBtService class

An implementation of BtServicePlatform that uses method channels.

Inheritance

Constructors

MethodChannelBtService()

Properties

hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
onData Stream<Uint8List>
Stream of incoming data as bytes.
no setteroverride
onDeviceDiscovered Stream<Map<String, dynamic>>
Stream of discovered devices during scanning.
no setteroverride
onState Stream<String>
Stream of state changes: 'connected','disconnected','error'.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect(String address) Future<void>
Connect to a device by MAC address (RFCOMM SPP UUID used).
override
disconnect() Future<void>
Disconnect the current connection.
override
getPairedDevices() Future<List<Map<String, dynamic>>>
Get list of paired devices.
override
getPlatformVersion() Future<String?>
override
isConnected() Future<bool>
Whether currently connected.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Uint8List bytes) Future<void>
Send raw bytes over the connected socket.
override
startScan() Future<void>
Start scanning for nearby Bluetooth devices.
override
stopScan() Future<void>
Stop scanning for devices.
override
toString() String
A string representation of this object.
inherited

Operators

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