ConnectionPool class

A class to manage connection pool settings for BLE devices.

Connection Pooling enables the exclusive connection of scanners to devices by using a 4-character hexadecimal ID. This ensures automatic and secure connections, especially in environments where multiple scanners are used across different devices.

This class allows setting and resetting the connection pool ID, validating hex IDs, and generating the corresponding QR data for a connection pool.

Example usage:

  • Use setHexId to set a specific hex ID for the device.
  • Use resetHexId to reset the device's connection pool ID to the default '0000'.
  • Use getConnectionPoolQRData to generate QR code data based on the current connection pool ID.
Annotations
  • @lazySingleton

Constructors

ConnectionPool(AppLogger _appLogger)

Properties

hashCode int
The hash code for this object.
no setterinherited
reservedHexIds List<String>
A list of reserved 4-character hexadecimal IDs that cannot be used for connection pooling.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getConnectionPoolQRData(String poolId) String
Generates a configuration command string that can be encoded into a QR code. The QR code data contains the necessary information to configure the device with the provided connection pool ID when scanned.
isValidHexId(String poolId) bool
Checks if the given ID is a valid 4-character hexadecimal value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetHexId(String deviceId) Future<CommandResponse>
Sends the reset command to the device, which reverts the connection pool ID to the default ('0000').
sendCommand(String deviceId, String command, {List<String> parameters = const [], bool sendFeedback = true}) Future<CommandResponse>
inherited
setHexId({required dynamic deviceId, required String poolId}) Future<CommandResponse>
Sets the connection pool ID to the specified 4-character hexadecimal value.
toString() String
A string representation of this object.
inherited

Operators

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