BluetoothLowEnergyPlugin class
Main BluetoothLE Plugin class
This plugin supports connecting to CC254X, Nordic nRF, and Microchip BLE devices with UART communication capabilities.
Constructors
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
-
onDataReceived
→ Stream<
DataEvent> -
Stream of data received from the connected BLE device
no setter
Static Methods
-
connect(
String deviceAddress) → Stream< ConnectionEvent> - Connect to a BLE device
-
connectAndWait(
String deviceAddress, {Duration timeout = const Duration(seconds: 30)}) → Future< bool> - Convenience method to connect and wait for successful connection
-
disconnect(
) → Future< void> - Disconnect from the currently connected BLE device
-
findDeviceByName(
String deviceName, {Duration timeout = const Duration(seconds: 10)}) → Future< BleDevice?> - Convenience method to scan and find a specific device by name
-
getConnectedDevice(
) → Future< String?> - Get the address of the currently connected device Returns null if no device is connected
-
getConnectionState(
) → Future< ConnectionState> - Get the current connection state
-
getPlatformVersion(
) → Future< String?> - Legacy method for plugin compatibility
-
hasPermissions(
) → Future< bool> - Check if all required BLE permissions are granted
-
isBluetoothEnabled(
) → Future< bool> - Check if Bluetooth is enabled on the device
-
requestPermissions(
) → Future< bool> - Request required BLE permissions from the user
-
sendData(
String data) → Future< bool> - Send data to the connected BLE device
-
startScan(
{Duration? timeout, List< String> ? serviceUuids}) → Stream<ScanEvent> - Start scanning for BLE devices
-
stopScan(
) → Future< void> - Stop scanning for BLE devices