Created
January 6, 2018 22:38
-
-
Save samuelsonbrito/b16d97ae11ae51193618062b427816bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FXML | |
private void conectar(ActionEvent event) { | |
if (btnConectar.getText().equals("Conectar")) { | |
porta = SerialPort.getCommPort(cbPortas.getSelectionModel().getSelectedItem().toString()); | |
porta.setComPortTimeouts(SerialPort.TIMEOUT_SCANNER, 0, 0); | |
if (porta.openPort()) { | |
btnConectar.setText("Desconectar"); | |
cbPortas.setDisable(true); | |
} | |
} else { | |
porta.closePort(); | |
cbPortas.setDisable(false); | |
btnConectar.setText("Conectar"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment