From 65a223734821b4d9aca4f165c0272d79c220cf19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Fri, 15 Jun 2012 16:06:03 +0200 Subject: [PATCH] cleanup --- src/de/ctdo/crashtest/domotics/IRelaisboard.java | 2 +- src/de/ctdo/crashtest/domotics/Relaisboard.java | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/de/ctdo/crashtest/domotics/IRelaisboard.java b/src/de/ctdo/crashtest/domotics/IRelaisboard.java index a5873de..2c78b4e 100644 --- a/src/de/ctdo/crashtest/domotics/IRelaisboard.java +++ b/src/de/ctdo/crashtest/domotics/IRelaisboard.java @@ -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(); } diff --git a/src/de/ctdo/crashtest/domotics/Relaisboard.java b/src/de/ctdo/crashtest/domotics/Relaisboard.java index 99170d6..7984c3a 100644 --- a/src/de/ctdo/crashtest/domotics/Relaisboard.java +++ b/src/de/ctdo/crashtest/domotics/Relaisboard.java @@ -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