Closed 01xJoao closed 5 years ago
Since the connect method doesn't have a timeout, if I try to connect to a turned off device it keeps trying to connect without stoping.
You can use dart's in-built timeout for streams.
final stream = RxBle.connect(deviceId, autoConnect: true).timeout( timeout, onTimeout: (sink) { ... }, ); await for (final state in stream) { ... }
Since the connect method doesn't have a timeout, if I try to connect to a turned off device it keeps trying to connect without stoping.