0
私はRXTXライブラリでjavaのCOMポートを読むつもりです。 ATコマンドのcharの流れを認識したい。JavaはRXTXライブラリでATコマンドを認識します
私の読書機能はバッファを循環させて、すべての文字列をvarに保存します。
InputStream in; //var sent to function
byte[] buffer = new byte[1024];
int len = -1;
try{
while ((len = in.read(buffer)>-1){
String s = new String(buffer,0,len);
// I've think to save all string into a global var and ciclically
// read after delay che global string and analyze it for bring the
// AT commands
Global.__GLstring += s;
System.out.print(s);
/* Example sout:
AT
OK
BLABLABLA
ERROR
*/
}
} catch (IOException e){
syserr("Exception"+e);
}
タイマーをバックグラウンドで作成するにはどうすればよいですか? すでに優れたソリューションや機能がありますか?
私は自分自身を説明できることを望みます。ありがとうございます!