sbis04/flutter_bluetooth

read failed, socket might closed or timeout, read ret: -1

ctrleffive opened this issue · 4 comments

Error occurred while connecting to a paired device.

W/BluetoothAdapter(28901): getBluetoothService() called with no BluetoothManagerCallback
E/FlutterBluePlugin(28901): read failed, socket might closed or timeout, read ret: -1
E/FlutterBluePlugin(28901): java.io.IOException: read failed, socket might closed or timeout, read ret: -1
E/FlutterBluePlugin(28901): 	at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:741)
E/FlutterBluePlugin(28901): 	at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:753)
E/FlutterBluePlugin(28901): 	at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:375)
E/FlutterBluePlugin(28901): 	at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin.lambda$connect$0(FlutterBluetoothSerialPlugin.java:235)
E/FlutterBluePlugin(28901): 	at io.github.edufolly.flutterbluetoothserial.-$$Lambda$FlutterBluetoothSerialPlugin$52C5RUgoP_r70sgAnP8ZXC1Ysz0.run(lambda)
E/FlutterBluePlugin(28901): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
E/FlutterBluePlugin(28901): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/FlutterBluePlugin(28901): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/FlutterBluePlugin(28901): 	at java.lang.Thread.run(Thread.java:760)

Flutter Doctor

[✓] Flutter (Channel stable, v1.2.1, on Linux, locale en_GB.UTF-8)
    • Flutter version 1.2.1 at /home/chandu/Flutter
    • Framework revision 8661d8aecd (3 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/chandu/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_SDK_ROOT = /home/chandu/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 33.3.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.31.1)
    • VS Code at /usr/share/code
    • Flutter extension version 2.24.0

[✓] Connected device (1 available)
    • Redmi Note 4 • 192.168.0.100:5555 • android-arm64 • Android 7.0 (API 24)

• No issues found!

There might be issues with the device with which you are trying to pair. What device are you pairing with?

@sbis04 Its a data logger for insulin pens. I'm now using flutter_blue for the functionality.

Ok. Is there anything else I can help you with?

ill close the issue. if i have the same issue while using this library, ill reopen it.