CentralMethodChannel class

An implementation of CentralPlatformInterface that uses method channels.

Inheritance

Constructors

CentralMethodChannel()

Properties

channel → MethodChannel
The method channel used to interact with the native platform.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkBluetoothAdapterStatus() → Future<BluetoothStatus>
Checks the status of the Bluetooth adapter on the device.
override
connect({required String deviceAddress}) → Future<Stream<BleConnectionEvent>>
Initiates a connection to a BLE peripheral and returns a Stream representing the connection state.
override
disconnect(String deviceAddress) → Future<void>
Asynchronously terminates the connection between the host mobile device and a Bluetooth Low Energy (BLE) peripheral.
override
discoverServices(String deviceAddress) → Future<Stream<List<BleService>>>
Initiates the service discovery process for a connected Bluetooth Low Energy (BLE) device and returns a Stream of discovered services and their characteristics.
override
emitCurrentBluetoothStatus() → Future<Stream<BluetoothStatus>>
Emits the current Bluetooth adapter status to the Dart side.
override
emitCurrentPermissionStatus() → Future<Stream<BluetoothPermissionStatus>>
Emits the current Bluetooth permission status to the Dart side.
override
getConnectedDevices(List<String> serviceUUIDs) → Future<List<ConnectedBleDevice>>
Gets a list of identifiers for all connected devices.
override
getCurrentConnectionState(String deviceAddress) → Future<BleConnectionState>
Fetches the current connection state of a Bluetooth Low Energy (BLE) device.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observeBondState({required String deviceAddress}) → Future<Stream<BleBondEvent>>
Observes the operating-system-managed bonding (pairing) process for the device with the given deviceAddress.
override
observeConnectionState({required String deviceAddress}) → Future<Stream<BleConnectionEvent>>
Observes connection state changes for a BLE device without initiating a connection.
override
readCharacteristic({required BleCharacteristic characteristic, required Duration timeout}) → Future<BleCharacteristicValue>
Reads the value of a specified Bluetooth characteristic.
override
readConnectionParameters({required String deviceAddress}) → Future<BleConnectionParameters?>
Returns a snapshot of the active BLE link parameters for the connected device.
override
refreshGattCache({required String deviceAddress}) → Future<void>
Clears the Android GATT cache for the connected device by invoking the hidden BluetoothGatt.refresh() method via reflection on the native side.
override
requestBluetoothPermissions() → Future<BluetoothPermissionStatus>
Requests Bluetooth permissions from the user.
override
requestConnectionPriority({required String deviceAddress, required BleConnectionPriority priority}) → Future<void>
Requests a specific connection priority for a connected device.
override
requestPreferredPhy({required String deviceAddress, required BlePhy txPhy, required BlePhy rxPhy}) → Future<void>
Requests a preferred PHY for the connection to the specified device.
override
startScan({List<ScanFilter>? filters, ScanSettings? settings}) → Future<Stream<BleDevice>>
Starts a scan for nearby Bluetooth Low Energy (BLE) devices and returns a stream of discovered devices.
override
stopScan() → Future<void>
Stops an ongoing Bluetooth scan and handles any potential errors.
override
subscribeToCharacteristic(BleCharacteristic characteristic) → Future<Stream<BleCharacteristicValue>>
Subscribes to a Bluetooth characteristic to listen for updates.
override
toString() → String
A string representation of this object.
inherited
unsubscribeFromCharacteristic(BleCharacteristic characteristic) → Future<void>
Unsubscribes from a Bluetooth characteristic.
override
writeCharacteristic({required BleCharacteristic characteristic, required String value, int? writeType}) → Future<void>
Asynchronously writes data to a specified Bluetooth Low Energy (BLE) characteristic.
override

Operators

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