Communication rebuild.

This commit is contained in:
dxl
2020-04-14 18:42:35 +08:00
parent 00886d3ba8
commit b81852de62
1090 changed files with 171 additions and 1747786 deletions
@@ -15,8 +15,14 @@ public abstract class DeviceChecker implements Serializable, Closeable {
public DeviceChecker(Communication communication) {
this.communication = communication;
initCom();
}
private void initCom(){
// Auto init communication to mapper.
ComBridgeAdapter.initCom(communication);
ComBridgeAdapter.getInstance()
.setInputStream(communication.getInput())
.setOutputStream(communication.getOutput());
}
/**
@@ -24,7 +30,10 @@ public abstract class DeviceChecker implements Serializable, Closeable {
*
* @return if can work return true, if no, return false
*/
public abstract boolean working() throws IOException;
public boolean check() throws IOException {
initCom();
return false;
}
/**
* Close the device(Should no close communication. only close device!)