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, null when the change was requested by the app.
final
errorCode → BleShieldNativeErrorCode?
Classification of the error. null on 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, not null. Connection related values:
final
hashCode → int
The hash code for this object.
no setterinherited
isConnected → bool
true after a successful connection, false after a disconnect or a failed connection attempt.
final
nativeErrorCode → int?
The raw platform value behind errorCode: CBError.Code on Apple, the GATT status of onConnectionStateChange on Android. The numeric ranges overlap across platforms (6 is connectionTimeout on Apple and an HCI reason on Android), so branch on errorCode and keep this for diagnostics. null where errorCode is null.
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