BleBondState enum

Enumeration representing the possible bonding states between a Bluetooth peripheral and the host platform.

What bonding is

Bonding (often used interchangeably with "pairing") is the process by which two Bluetooth devices exchange and persist long-term keys so that future connections can be encrypted without repeating the pairing exchange. It is a distinct concept from connection: a device can be connected without being bonded, and can remain bonded across disconnections.

The operating system owns bonding

On both Android and iOS the bonding process itself is performed by the operating system, not by this plugin. A Flutter app using this plugin can provoke bonding (on Android by explicitly requesting it, and on both platforms by interacting with an encrypted characteristic), but it cannot drive the pairing exchange directly. These states therefore report what the OS is doing, to the extent the OS exposes it.

  • none: No bond exists between the host and the peripheral.
  • bonding: The operating system is actively establishing a bond with the peripheral.
  • bonded: A bond has been successfully established and persisted.
  • failed: An attempt to establish a bond failed. The accompanying BleBondEvent failure describes why, to the extent the platform provides that information.
  • unknown: The bonding state could not be determined.
Inheritance
Available extensions

Values

none → const BleBondState

No bond exists between the host and the peripheral.

const BleBondState('none')
bonding → const BleBondState

The operating system is actively establishing a bond with the peripheral.

const BleBondState('bonding')
bonded → const BleBondState

A bond has been successfully established and persisted by the operating system.

const BleBondState('bonded')
failed → const BleBondState

An attempt to establish a bond failed.

When a BleBondState of failed is reported, the accompanying BleBondEvent failure describes why the attempt failed, to the extent the platform provides that information. On Android this detail is often rich (an unbond reason code); on iOS it is limited by the platform (see BleBondFailure).

const BleBondState('failed')
unknown → const BleBondState

The bonding state, or lack thereof, between the peripheral and the host device is in an unknown state.

const BleBondState('unknown')

Properties

hashCode → int
The hash code for this object.
no setterinherited
identifier → String
A String identifier for each BleBondState value, matching the value emitted by the native platforms.
final
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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 Methods

fromIdentifier(String? identifier) → BleBondState
Resolves a BleBondState from its String identifier as sent by the native platform.

Constants

values → const List<BleBondState>
A constant List of the values in this enum, in order of their declaration.