The interface that platform-specific implementations must implement.
Platform implementations should extend this class rather than implement it,
as new methods may be added in the future. Using extends ensures
forward compatibility.
- Inheritance
-
- Object
- PlatformInterface
- FlutterClassicBluetoothPlatform
- Implementers
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
-
adapterState(
) → Stream< BtcAdapterState> - Returns the current adapter state as a stream that emits on changes.
-
bondDevice(
String address) → Future< bool> -
Initiates pairing with the device at
address. -
bondState(
String address) → Stream< BtcBondState> - Stream of bond state changes for a specific device.
-
connect(
{required String address, String uuid = BtcUuid.spp, bool secure = true}) → Future< BtcConnection> -
Connects to the device at
addressusing the givenuuid. -
disableBluetooth(
) → Future< bool> - Requests the system to disable the Bluetooth adapter.
-
disconnect(
int id) → Future< void> -
Disconnects the connection with the given
id. -
discoveryResults(
) → Stream< BtcDevice> - Stream of devices found during discovery.
-
discoveryState(
) → Stream< bool> -
Stream that emits
truewhen discovery starts andfalsewhen it stops. -
enableBluetooth(
) → Future< bool> - Requests the system to enable the Bluetooth adapter.
-
getAdapterAddress(
) → Future< String?> - Returns the local adapter's hardware address.
-
getAdapterName(
) → Future< String?> - Returns the local adapter's friendly name.
-
getPairedDevices(
) → Future< List< BtcDevice> > - Returns the list of currently paired/bonded devices.
-
getPlatformCapabilities(
) → Future< BtcPlatformCapabilities> - Returns the platform capabilities for Bluetooth Classic.
-
isDiscovering(
) → Future< bool> - Returns whether a discovery scan is currently in progress.
-
isEnabled(
) → Future< bool> - Returns whether the Bluetooth adapter is currently enabled.
-
isSupported(
) → Future< bool> - Returns whether Bluetooth Classic is supported on this device.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDiscoverable(
int durationSeconds) → Future< bool> -
Makes the local device discoverable for
durationSeconds. -
startDiscovery(
) → Future< void> - Starts discovering nearby Bluetooth Classic devices.
-
startServer(
{required String serviceName, String uuid = BtcUuid.spp, bool secure = true}) → Future< BtcServerSocket> -
Creates an RFCOMM server socket listening on the given
uuid. -
stopDiscovery(
) → Future< void> - Stops an ongoing device discovery.
-
stopServer(
int id) → Future< void> -
Stops the server with the given
id. -
toString(
) → String -
A string representation of this object.
inherited
-
unbondDevice(
String address) → Future< bool> -
Removes the bond with the device at
address. -
write(
int id, Uint8List data) → Future< void> -
Writes
datato the connection with the givenid.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ FlutterClassicBluetoothPlatform
-
The default instance of FlutterClassicBluetoothPlatform to use.
getter/setter pair