You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/05/30 15:35:47 UTC

[incubator-plc4x] branch master updated: serial ads protocol: as soon as we transmitted the ack frame we unset the boolean

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git


The following commit(s) were added to refs/heads/master by this push:
     new 430b3a0  serial ads protocol: as soon as we transmitted the ack frame we unset the boolean
430b3a0 is described below

commit 430b3a0bdb2f50bdf0bc47c15facb4e4ff8df4bd
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed May 30 17:35:44 2018 +0200

    serial ads protocol: as soon as we transmitted the ack frame we unset the boolean
---
 .../org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java   | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java
index 379beae..1fd4c42 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java
@@ -20,7 +20,6 @@ package org.apache.plc4x.java.ads.protocol;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelFutureListener;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.codec.MessageToMessageCodec;
 import io.netty.util.ReferenceCountUtil;
@@ -109,11 +108,9 @@ public class Payload2SerialProtocol extends MessageToMessageCodec<ByteBuf, ByteB
                 LOGGER.debug("Ams Serial Frame received {}", amsSerialFrame);
                 // TODO: check if this is the right way to ack a package.
                 ChannelFuture channelFuture = channelHandlerContext.writeAndFlush(AmsSerialAcknowledgeFrame.of(transmitterAddress, receiverAddress, fragmentNumber));
-                channelFuture.addListener((ChannelFutureListener) future -> {
-                    frameOnTheWay.set(false);
-                });
                 // waiting for the ack-frame to be transmitted before we forward the package
                 channelFuture.await();
+                frameOnTheWay.set(false);
                 out.add(userData.getByteBuf());
                 break;
             case AmsSerialAcknowledgeFrame.ID:

-- 
To stop receiving notification emails like this one, please contact
sruehl@apache.org.