cleanup
This commit is contained in:
parent
50ee753667
commit
65a2237348
|
@ -5,6 +5,6 @@ public interface IRelaisboard {
|
||||||
void toggleRelais(final int relais, final int milliseconds);
|
void toggleRelais(final int relais, final int milliseconds);
|
||||||
void blinkRelais(final int relais, final int pause);
|
void blinkRelais(final int relais, final int pause);
|
||||||
void blinkRelaisStop(final int relais);
|
void blinkRelaisStop(final int relais);
|
||||||
boolean open();
|
void open();
|
||||||
void close();
|
void close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,13 +45,13 @@ public class Relaisboard implements IRelaisboard {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean open() {
|
public void open() {
|
||||||
serialPortGeoeffnet = false;
|
serialPortGeoeffnet = false;
|
||||||
Boolean foundPort = false;
|
Boolean foundPort = false;
|
||||||
|
|
||||||
if (serialPortGeoeffnet) {
|
if (serialPortGeoeffnet) {
|
||||||
Logger.sLog("Serialport bereits geöffnet");
|
Logger.sLog("Serialport bereits geöffnet");
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Enumeration enumComm = CommPortIdentifier.getPortIdentifiers();
|
Enumeration enumComm = CommPortIdentifier.getPortIdentifiers();
|
||||||
|
@ -66,7 +66,7 @@ public class Relaisboard implements IRelaisboard {
|
||||||
}
|
}
|
||||||
if (!foundPort) {
|
if (!foundPort) {
|
||||||
Logger.sLog("Serialport nicht gefunden: " + portName);
|
Logger.sLog("Serialport nicht gefunden: " + portName);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -77,8 +77,6 @@ public class Relaisboard implements IRelaisboard {
|
||||||
|
|
||||||
outputStream = serialPort.getOutputStream();
|
outputStream = serialPort.getOutputStream();
|
||||||
serialPortGeoeffnet = true;
|
serialPortGeoeffnet = true;
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (PortInUseException e) {
|
} catch (PortInUseException e) {
|
||||||
Logger.sLog("Relaisboard error: Port belegt " + portName);
|
Logger.sLog("Relaisboard error: Port belegt " + portName);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -86,8 +84,6 @@ public class Relaisboard implements IRelaisboard {
|
||||||
} catch(UnsupportedCommOperationException e) {
|
} catch(UnsupportedCommOperationException e) {
|
||||||
Logger.sLog("Relaisboard error: Konnte Schnittstellen-Paramter nicht setzen");
|
Logger.sLog("Relaisboard error: Konnte Schnittstellen-Paramter nicht setzen");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue