CentralMethodChannel class
An implementation of CentralPlatformInterface that uses method channels.
- Inheritance
-
- Object
- PlatformInterface
- CentralPlatformInterface
- CentralMethodChannel
Constructors
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}) → Stream< BleConnectionState> -
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) → 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(
) → Stream< BluetoothStatus> -
Emits the current Bluetooth adapter status to the Dart side.
override
-
emitCurrentPermissionStatus(
) → 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
-
readCharacteristic(
{required BleCharacteristic characteristic, required Duration timeout}) → Future< BleCharacteristicValue> -
Reads the value of a specified Bluetooth characteristic.
override
-
requestBluetoothPermissions(
) → Future< BluetoothPermissionStatus> -
Requests Bluetooth permissions from the user.
override
-
startScan(
{List< ScanFilter> ? filters, ScanSettings? settings}) → 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) → Stream< BleCharacteristicValue> -
Subscribes to a Bluetooth characteristic to listen for updates.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeFromCharacteristic(
BleCharacteristic characteristic) → 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