BtService class

High-level API for the bt_service plugin (Android / Classic Bluetooth RFCOMM).

Properties

hashCode int
The hash code for this object.
no setterinherited
onData Stream<Uint8List>
Stream of incoming bytes from the connected device. Emits Uint8List.
no setter
onDeviceDiscovered Stream<Map<String, dynamic>>
Stream of discovered devices during scanning. Emits Map<String, dynamic> with 'address', 'name', and 'type'.
no setter
onState Stream<String>
Stream of connection state changes: values are 'connected','disconnected','error'.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Properties

instance BtService
final