CentralPlatformInterface class abstract
The interface that implementations of splendid_ble must implement.
- Inheritance
-
- Object
- PlatformInterface
- CentralPlatformInterface
- Implementers
Constructors
- CentralPlatformInterface.new()
- Constructs a CentralPlatformInterface.
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
-
checkBluetoothAdapterStatus(
) → Future< BluetoothStatus> - Checks the status of the host device's Bluetooth adapter and returns a BluetoothStatus to communicate the current status of the adapter.
-
connect(
{required String deviceAddress}) → Stream< BleConnectionState> - Initiates a connection to a BLE peripheral and returns a Stream representing the connection state.
-
disconnect(
String deviceAddress) → Future< void> - Terminates the connection to a BLE peripheral. Initiates a connection to a BLE peripheral and returns a Stream representing the connection state.
-
discoverServices(
String deviceAddress) → Stream< List< BleService> > - Triggers the service discovery process manually.
-
emitCurrentBluetoothStatus(
) → Stream< BluetoothStatus> - Emits the current Bluetooth adapter status to the Dart side.
-
emitCurrentPermissionStatus(
) → Stream< BluetoothPermissionStatus> - Emits the current Bluetooth permission status whenever it changes.
-
getConnectedDevices(
List< String> serviceUUIDs) → Future<List< ConnectedBleDevice> > - Returns a list of BLE device identifiers that are currently connected to the host device.
-
getCurrentConnectionState(
String deviceAddress) → Future< BleConnectionState> - Returns the current connection state for the Bluetooth device with the specified address.
-
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.
-
requestBluetoothPermissions(
) → Future< BluetoothPermissionStatus> - Requests Bluetooth permissions from the user.
-
startScan(
{List< ScanFilter> ? filters, ScanSettings? settings}) → Stream<BleDevice> - Starts a scan for nearby BLE devices and returns a Stream of BleDevice instances representing the BLE devices that were discovered. On the Flutter side, listeners can be added to this stream so they can respond to Bluetooth devices being discovered, for example by presenting the list in the user interface or enabling controllers to find and connect to specific devices.
-
stopScan(
) → void - Stops an ongoing Bluetooth scan or, if no scan is running, does nothing.
-
subscribeToCharacteristic(
BleCharacteristic characteristic) → Stream< BleCharacteristicValue> - Subscribes to a Bluetooth characteristic to listen for updates.
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeFromCharacteristic(
BleCharacteristic characteristic) → void - Unsubscribes from a Bluetooth characteristic.
-
writeCharacteristic(
{required BleCharacteristic characteristic, required String value, int? writeType}) → Future< void> - Writes data to a specified characteristic.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ CentralPlatformInterface
-
The default instance of CentralPlatformInterface to use.
getter/setter pair