pair method

  1. @nonVirtual
void pair({
  1. required String bleAddress,
  2. String? bleName,
  3. List<String>? serviceUuids,
  4. List<int>? manufacturerData,
})

Pair this device manager with a BLE device by specifying the bleAddress, and optionally its bleName, serviceUuids, and manufacturerData.

Implementation

@nonVirtual
void pair({
  required String bleAddress,
  String? bleName,
  List<String>? serviceUuids,
  List<int>? manufacturerData,
}) {
  this.bleAddress = bleAddress;
  this.bleName = bleName;
  this.serviceUuids = serviceUuids ?? [];
  this.manufacturerData = manufacturerData ?? [];
  if (onPaired()) {
    status = DeviceStatus.paired;
    info('$runtimeType - Paired with BLE device: $bleAddress');
  } else {
    warning('$runtimeType - Failed to pair with BLE device: $bleAddress');
  }
}