jssc を使用して機器と通信しています。
Windows と Linux ではプログラムは問題ありませんでしたが、ウイルスに問題があり、PC をフォーマットすると、プログラムは 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();
}