felHR85 / UsbSerial

Usb serial controller for Android
MIT License
1.78k stars 581 forks source link

when should i call close() #329

Open curiousbabyMz opened 3 years ago

curiousbabyMz commented 3 years ago

i try to close the connection but fail it always show InterruptedException

i call close() at the end of my UsbReadCallback function , is it right?

on the other side , i can't send write() twice in one connection ,the second response is wrong with 00 00 00 00.....

that is the tip W/System.err: at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:442) at java.lang.Object.wait(Object.java:568) at com.felhr.usbserial.SerialBuffer$SynchronizedBuffer.get(SerialBuffer.java:117) at com.felhr.usbserial.SerialBuffer.getWriteBuffer(SerialBuffer.java:72) at com.felhr.usbserial.UsbSerialDevice$WriteThread.doRun(UsbSerialDevice.java:402) at com.felhr.usbserial.AbstractWorkerThread.run(AbstractWorkerThread.java:21)

jhui20130703 commented 9 months ago

Have you solved it? I encountered the same problem as you.