When app read from serial port, if occurs the error message: "Level 3 halted" in the log, that means the serial port cable is disconnected, then close the serial port in the app, then try to open it again. If app can not open serial port, please try to connect the serial port cable again.
In Java SDK, you can catch the DeviceException when do serail port read, snippet code:
try {
byte[] readBytes = new byte[256];
SerialPortOperationResult serialPortOperationResult = serialPortDevice.waitForRead(readBytes.length, TimeConstants.FOREVER);
int resultCode = serialPortOperationResult.getResultCode();
if (resultCode == SerialPortOperationResult.SUCCESS) {
byte[] data = serialPortOperationResult.getData();
Logger.debug("read success:" + new String(data));
} else if (resultCode == SerialPortOperationResult.LEVEL_3_HALTED) {
Logger.debug("devices is gone, please close it first, then open it again.");
serialPortDevice.close();
}
} catch (DeviceException e) {
e.printStackTrace();
}