0
我正在使用jssc與設備進行通信。
在Windows和Linux的程序是好的,但我有一個病毒問題,我格式化我的電腦,然後該程序不適用於Windows,但與Linux程序工作正常。
我不知道爲什麼程序停止工作。
程序代碼是:jssc windows和linux
try {
command = new String(commandSend);
serialPort.writeBytes(command.getBytes());
logger.info("Sending to port " + a.getPort() + " " + command);
Thread.sleep(1000);//Wait 0.8 seconds
retorno = serialPort.readString();
} catch (Exception e) {
logger.error("Problems with send/receive command with the analyzer");
logger.error(e.getMessage());
logger.error(e.toString());
e.printStackTrace();
}
也許你可以搜索代碼停止,然後編輯你的問題 – lrleon
當然,問題是在Linux serialPort.readString()正常返回,但在Windows返回null,這是非常混亂的程序工作正常,直到我格式化我的電腦,然後該計劃不起作用 –