You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/08/10 19:28:45 UTC

[plc4x] 02/02: chore(plc4j): Made the profinet driver sort of react to the case that the PLC rejects the connection

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

cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 7fa925ccf3e2234b43fd0aa6926596a1b04ccf72
Author: Christofer Dutz <ch...@rivian.com>
AuthorDate: Wed Aug 10 21:28:36 2022 +0200

    chore(plc4j): Made the profinet driver sort of react to the case that the PLC rejects the connection
---
 .../org/apache/plc4x/java/profinet/protocol/ProfinetProtocolLogic.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetProtocolLogic.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetProtocolLogic.java
index b05b3b909..1d6d138e0 100644
--- a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetProtocolLogic.java
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetProtocolLogic.java
@@ -157,6 +157,8 @@ public class ProfinetProtocolLogic extends Plc4xProtocolBase<Ethernet_Frame> {
                 } else {
                     throw new PlcException("Unexpected response");
                 }
+            } else if (dceRpc_packet.getPacketType() == DceRpc_PacketType.REJECT) {
+                throw new PlcException("Device rejected connection request");
             } else {
                 throw new PlcException("Unexpected response");
             }