?? readserial.java
字號(hào):
package serial;
import java.io.*;
/**
*
* This class reads message from the specific serial port and save the message
* to the serial buffer.
*
*/
public class ReadSerial extends Thread {
private SerialBuffer ComBuffer;
private InputStream ComPort;
/**
*
* Constructor
*
* @param SB
* The buffer to save the incoming messages.
* @param Port
* The InputStream from the specific serial port.
*
*/
public ReadSerial(SerialBuffer SB, InputStream Port) {
ComBuffer = SB;
ComPort = Port;
}
public void run() {
int c;
try {
while (true) {
c = ComPort.read();
ComBuffer.PutChar(c);
}
} catch (IOException e) {
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -