pair method
void
pair({
- required String bleAddress,
- String? bleName,
- List<
String> ? serviceUuids, - 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');
}
}