BluetoothSubscriptionException class

BluetoothSubscriptionException is a custom exception that is thrown when an error occurs while attempting to subscribe to notifications or indications from a Bluetooth Low Energy (BLE) characteristic. This type of exception is particularly useful for handling the intricacies of BLE communication where setting up notifications or indications can fail due to a range of issues, such as connection instability, incorrect characteristic properties, insufficient permissions, or unsupported operations by the BLE peripheral.

The message field is intended to provide a more detailed description of the error, often including specific error codes or additional context provided by the BLE framework or the underlying platform.

Example

try {
  // Code to subscribe to a BLE characteristic for notifications or indications
} on BluetoothSubscriptionException catch (e) {
  // Handle the exception by possibly retrying or notifying the user
  print(e);
}
Implemented types

Constructors

BluetoothSubscriptionException(String message)
Creates a BluetoothSubscriptionException with the specified error message.

Properties

hashCode int
The hash code for this object.
no setterinherited
message String
A message describing the error that occurred during the subscription process.
final
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.
override

Operators

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