addPeripheral method

  1. @protected
void addPeripheral(
  1. BlePeripheral device
)
inherited

Implementation

@protected
void addPeripheral(BlePeripheral device) {
  final knownDeviceIndex = devices.indexWhere((d) => d.id == device.id);
  if (knownDeviceIndex >= 0) {
    devices[knownDeviceIndex] = device;
  } else {
    devices.add(device);
  }
  notifyState(state);
}