BluetoothDevice class

Constructors

BluetoothDevice.fromDeviceId(String deviceId)
Creates a BluetoothDevice with a predefined device ID. Be aware that the device ID could change anytime so the proper way is to scan for the device first. This constructor is created for a workaround to be able to reconnect on Android to devices which has still an unreleased connection with the phone after app restart.
BluetoothDevice.fromProto(BluetoothDevice p)

Properties

canSendWriteWithoutResponse Future<bool>
Indicates whether the Bluetooth Device can send a write without response
no setter
hashCode int
The hash code for this object.
no setteroverride
id DeviceIdentifier
final
isDiscoveringServices Stream<bool>
no setter
mtu Stream<int>
The MTU size in bytes
no setter
name String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
services Stream<List<BluetoothService>>
Returns a list of Bluetooth GATT services offered by the remote device This function requires that discoverServices has been completed for this device
no setter
state Stream<BluetoothDeviceState>
The current connection state of the device
no setter
type BluetoothDeviceType
final

Methods

connect({Duration? timeout, bool autoConnect = true}) Future<BluetoothDeviceState>
Establishes a connection to the Bluetooth Device.
disconnect(Duration? timeout) Future<BluetoothDeviceState>
Cancels connection to the Bluetooth Device
discoverServices() Future<List<BluetoothService>>
Discovers services offered by the remote device as well as their characteristics and descriptors
killPendingConnection() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readRemoteRSSI() Future<int>
requestMtu(int desiredMtu) Future<void>
Request to change the MTU Size Throws error if request did not complete successfully
toString() String
A string representation of this object.
override

Operators

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