kenjdavidson / react-native-bluetooth-classic

⚛ Bluetooth classic Android(Bluetooth)/IOS(ExternalAccessory) module for serial communication
https://kenjdavidson.github.io/react-native-bluetooth-classic
MIT License
249 stars 93 forks source link

java.io.IOException: read failed, socket might closed or timeout, read ret: -1 #310

Closed xudo49 closed 8 months ago

xudo49 commented 8 months ago

Mobile Device Environment Provide a list of operating systems on which this issue is relevant. Android

Application Environment Provide information about your development environment:

Describe the bug

connect SUNMI to OPPO when I called connectToDevice method, it throw this error java.io.IOException: read failed, socket might closed or timeout, read ret: -1

in the same case SUNMI bundle bluetooth printer I try to connect using connectToDevice method [ it worked ]

To Reproduce Steps to reproduce the behavior:

  1. discovery Device
  2. pair between 2 devices
  3. try to use connectToDevice method
  4. See error
image
kenjdavidson commented 8 months ago

This seems like a peripheral error, if the library works with one device but doesn't work with the other:

If you want, feel free to debug it, and if you find something open a PR that may assist others, but there isn't much I can do for specific devices. I'll leave this task open for a few days so that you can provide some debugging information and maybe a PR.

xudo49 commented 8 months ago

@kenjdavidson Thanks for response I just try last hour change host device is works!!, but when I sand some text to SUNMI it called bluetooth printer all of time , I think my issue was born when I using a SUNMI devices make is a host