pair method

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

Pairs this device manager with the BLE device at bleAddress.

Optionally sets its bleName, serviceUuids, and manufacturerData. Sets status to DeviceStatus.paired if onPaired returns true.

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');
  }
}