diff --git a/.classpath b/.classpath index b6f44cd..d75ad75 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 7341ab1..3a21537 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/src/org/hwo/servicelink/ServiceLink.java b/src/org/hwo/servicelink/ServiceLink.java index 91a328c..86bf4a5 100644 --- a/src/org/hwo/servicelink/ServiceLink.java +++ b/src/org/hwo/servicelink/ServiceLink.java @@ -70,12 +70,12 @@ public class ServiceLink implements NewSerialPortListener { public ServiceLink(NewSerialPort serialPort) { - this.requestTimeOut = 25; + this.requestTimeOut = 100; this.serviceLinkListeners = new LinkedList(); this.retries = 3; this.serialPort = serialPort; - this.serialPort.setTimeOut(250); + this.serialPort.setTimeOut(25); this.serialPort.addNewSerialPortListener(this); this.serviceRegisterCache = new ServiceRegisterCache(this); this.asynchronServiceLinkProvider = new AsynchronServiceLinkProvider(serviceRegisterCache); @@ -95,9 +95,9 @@ public class ServiceLink implements NewSerialPortListener { private void _open(){ this.txWorker = new TxWorker(); this.rxWorker = new RxWorker(); - + + this.serialPort.setTimeOut(25); this.serialPort.open(); - this.serialPort.setTimeOut(250); this.txWorker.start(); this.rxWorker.start(); @@ -426,6 +426,7 @@ public class ServiceLink implements NewSerialPortListener { ServiceLink.this.close(); }; } + } } diff --git a/src/org/hwo/servicelink/ServiceLinkV2Telegram.java b/src/org/hwo/servicelink/ServiceLinkV2Telegram.java index cae0ee7..16b0e56 100644 --- a/src/org/hwo/servicelink/ServiceLinkV2Telegram.java +++ b/src/org/hwo/servicelink/ServiceLinkV2Telegram.java @@ -47,9 +47,10 @@ public class ServiceLinkV2Telegram extends ServiceLinkTelegram { throw new RuntimeException(e); } - if (bufferUsed != 8) + if (bufferUsed != 8){ + //log(DEBUG,"ServiceLinkV2Telegram: bufferUsed == %d !!",bufferUsed); return false; - + } log(DEBUGDETAIL,"RX BYTES: %s",ByteArrayHexlifier.byteArrayToString(buffer)); setAddress(new ServiceLinkAddress((buffer[1]>>4) & 0x0F, buffer[1] & 0x0F, (((int)buffer[2])&0xff) | (((int)buffer[3])<<8)&0xFF00 ));