UniversalBluetooth class

Constructors

UniversalBluetooth()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

beaconScanResults Stream<BeaconDevice>
Get stream of discovered beacons
no setter
bleScanResults Stream<BleDevice>
Get stream of discovered BLE devices
no setter
bluetoothScanFinished Stream<void>
Get stream for Classic Bluetooth scan completion
no setter
bluetoothScanResults Stream<BluetoothScanResult>
Get stream of discovered Classic Bluetooth devices
no setter
isBeaconSupported Future<bool>
iBeacon Methods Check if iBeacon is supported
no setter
isBleAvailable Future<bool>
BLE (Bluetooth Low Energy) Methods Check if BLE is available
no setter
isBluetoothAvailable Future<bool>
Classic Bluetooth Methods Check if Classic Bluetooth is available
no setter
isBluetoothEnabled Future<bool>
Check if Classic Bluetooth is enabled
no setter

Static Methods

bleCharacteristicValueChanged(String deviceId, String serviceUuid, String characteristicUuid) Stream<List<int>>
Listen for BLE characteristic value changes
bleConnectionStateChanged(String deviceId) Stream<BluetoothConnectionState>
Get BLE connection state stream
bluetoothConnectionStateChanged(String deviceId) Stream<BluetoothConnectionState>
Get Classic Bluetooth connection state stream
bluetoothDataReceived(String deviceId) Stream<List<int>>
Listen for incoming data from Classic Bluetooth device
connectToBleDevice(String deviceId) Future<void>
Connect to BLE device
connectToBluetoothDevice(String deviceId) Future<void>
Connect to a Classic Bluetooth device
disconnectBleDevice(String deviceId) Future<void>
Disconnect from BLE device
disconnectBluetoothDevice(String deviceId) Future<void>
Disconnect from Classic Bluetooth device
discoverBleServices(String deviceId) Future<List<String>>
Discover services for connected BLE device
getBleCharacteristics(String deviceId, String serviceUuid) Future<List<String>>
Get characteristics for a service
getBluetoothAddress() Future<String>
Get Bluetooth MAC address
readBleCharacteristic(String deviceId, String serviceUuid, String characteristicUuid) Future<List<int>>
Read characteristic value
requestBluetoothEnable() Future<bool>
Request to enable Bluetooth
requestLocationPermission() Future<bool>
Request location permissions (required for beacon scanning)
sendBluetoothData(String deviceId, List<int> data) Future<void>
Send data to connected Classic Bluetooth device
startBeaconAdvertising({required String uuid, required int major, required int minor, String? identifier}) Future<void>
Start advertising as iBeacon
startBeaconScanning({List<String>? uuids}) Future<void>
Start scanning for iBeacons
startBleScan({List<String>? serviceUuids, Duration? timeout}) Future<void>
Start scanning for BLE devices
startBluetoothDiscoverable({int duration = 120}) Future<bool>
Make device discoverable for Classic Bluetooth
startBluetoothScan() Future<void>
Start scanning for Classic Bluetooth devices
stopBeaconAdvertising() Future<void>
Stop beacon advertising
stopBeaconScanning() Future<void>
Stop beacon scanning
stopBleScan() Future<void>
Stop BLE scan
stopBluetoothDiscoverable() Future<void>
Stop Classic Bluetooth discoverability
stopBluetoothScan() Future<void>
Stop scanning for Classic Bluetooth devices
subscribeBleCharacteristic(String deviceId, String serviceUuid, String characteristicUuid) Future<void>
Subscribe to characteristic notifications
unsubscribeBleCharacteristic(String deviceId, String serviceUuid, String characteristicUuid) Future<void>
Unsubscribe from characteristic notifications
writeBleCharacteristic(String deviceId, String serviceUuid, String characteristicUuid, List<int> data, {bool withoutResponse = false}) Future<void>
Write to characteristic