0
私はJavaのシリアルポートからデータを読み込んでいますが、完全なデータが得られていません。それは10に分割されます。シリアルポートのJavaを読む問題
は例:ターゲットデバイスがdatas_ok
を書き込み
場合は、私が最初にdatas_
を取得するには、その後ok
秒の時間をお読みください。
case SerialPortEvent.DATA_AVAILABLE:
try {
while (inputStream.available() > 0) {
numBytes = inputStream.available();
readBufferArray = new byte[numBytes];
// int readtheBytes = (int) inputStream.skip(2);
int readBytes = inputStream.read(readBufferArray);
one = new String(readBufferArray);
System.out.println("readBytes " + one);
handleFlashResponse(one);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
何が問題なのですか。
Hmm。 http://stackoverflow.com/questions/348777/reading-com-port-value-and-printing-in-textarea-which-located-inside-the-panel-私は宿題を見つける。 –