This commit is contained in:
Lucas Pleß 2012-06-15 16:06:03 +02:00
parent 50ee753667
commit 65a2237348
2 changed files with 4 additions and 8 deletions

View File

@ -5,6 +5,6 @@ public interface IRelaisboard {
void toggleRelais(final int relais, final int milliseconds);
void blinkRelais(final int relais, final int pause);
void blinkRelaisStop(final int relais);
boolean open();
void open();
void close();
}

View File

@ -45,13 +45,13 @@ public class Relaisboard implements IRelaisboard {
@Override
public boolean open() {
public void open() {
serialPortGeoeffnet = false;
Boolean foundPort = false;
if (serialPortGeoeffnet) {
Logger.sLog("Serialport bereits geöffnet");
return false;
return;
}
Enumeration enumComm = CommPortIdentifier.getPortIdentifiers();
@ -66,7 +66,7 @@ public class Relaisboard implements IRelaisboard {
}
if (!foundPort) {
Logger.sLog("Serialport nicht gefunden: " + portName);
return false;
return;
}
try {
@ -77,8 +77,6 @@ public class Relaisboard implements IRelaisboard {
outputStream = serialPort.getOutputStream();
serialPortGeoeffnet = true;
return true;
} catch (PortInUseException e) {
Logger.sLog("Relaisboard error: Port belegt " + portName);
} catch (IOException e) {
@ -86,8 +84,6 @@ public class Relaisboard implements IRelaisboard {
} catch(UnsupportedCommOperationException e) {
Logger.sLog("Relaisboard error: Konnte Schnittstellen-Paramter nicht setzen");
}
return false;
}
@Override