taiyangfeng / android-serialport-api

Automatically exported from code.google.com/p/android-serialport-api
0 stars 0 forks source link

uart_close will not be called while SerialPortActivity onDestroy #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I add trace message in serial driver in uart_close function
2. while SerialPortActivity onDestroy, uart_close will not be called
3. If remove following code in private class ReadThread extends Thread, 
uart_close will be called

                try {
                    byte[] buffer = new byte[64];
                    if (mInputStream == null) return;
                    size = mInputStream.read(buffer);
                    size =1;
                    if (size > 0) {
                        onDataReceived(buffer, size);
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                    return;
                }

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
android-serialport-api version1.1, on Android 2.3, 

Original issue reported on code.google.com by xuyangc...@gmail.com on 12 Dec 2011 at 3:10