private void reset(){
  serialInterface.ifPresent(null);
  serialInterface=Optional.empty();
  cancelRead();
  cancelWrite();
}

private void reset ( ) { serialInterface . ifPresent ( null ) ; serialInterface = Optional . empty ( ) ; cancelRead ( ) ; cancelWrite ( ) ; }
reset the state of the module , its ports , and , if there was one , the serial interface , then clears it .
