BleConnectionChange class
A connection state change of a device, including the platform's error details when the change was not requested by the app.
Constructors
- BleConnectionChange({required String deviceId, required bool isConnected, String? error, BleShieldNativeErrorCode? errorCode, int? nativeErrorCode})
-
const
Properties
- deviceId → String
-
Device id in its canonical form (lower-case on native platforms, verbatim on Web).
final
- error → String?
-
Human readable error,
nullwhen the change was requested by the app.final - errorCode → BleShieldNativeErrorCode?
-
Classification of the error.
nullon success and where the platform reports no code at all: Windows, Linux and Web, and (usually) a disconnect requested by the app. A code the plugin does not recognise is BleShieldNativeErrorCode.unknownError, notnull. Connection related values:final - hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
trueafter a successful connection,falseafter a disconnect or a failed connection attempt.final - nativeErrorCode → int?
-
The raw platform value behind errorCode:
CBError.Codeon Apple, the GATTstatusofonConnectionStateChangeon Android. The numeric ranges overlap across platforms (6 isconnectionTimeouton Apple and an HCI reason on Android), so branch on errorCode and keep this for diagnostics.nullwhere errorCode isnull.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