From 0fa9473dbf9f894b738a3f2b8ea78d72a5a7646d Mon Sep 17 00:00:00 2001 From: g4rb4g3 Date: Thu, 11 Jul 2024 15:15:22 +0200 Subject: [PATCH] fix: timeout killing working connection --- android/src/main/java/com/bleplx/adapter/BleModule.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/bleplx/adapter/BleModule.java b/android/src/main/java/com/bleplx/adapter/BleModule.java index 0fbed672..2bae763e 100755 --- a/android/src/main/java/com/bleplx/adapter/BleModule.java +++ b/android/src/main/java/com/bleplx/adapter/BleModule.java @@ -1267,7 +1267,10 @@ private void safeConnectToDevice(final RxBleDevice device, } if (timeout != null) { - connect = connect.timeout(timeout, TimeUnit.MILLISECONDS); + connect = connect.timeout( + Observable.timer(timeout, TimeUnit.MILLISECONDS), + item -> Observable.never() + ); }