connect method

  1. @override
Future<void> connect()
override

Implementation

@override
Future<void> connect() async {
  await device.connect();

  int attempts = 0;
  do {
    await Future.delayed(const Duration(milliseconds: 100));
    attempts++;
  } while (attempts < 10 && !device.connected);

  _updateConnectorStatus(device.connected
      ? BleConnectorStatus.connected
      : BleConnectorStatus.disconnected);
}