andvasp commented on code in PR #2674:
URL: https://github.com/apache/plc4x/pull/2674#discussion_r3753733624


##########
plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/base/EipTcpConnection.java:
##########
@@ -280,6 +278,48 @@ private CompletableFuture<Void> probeAttributes() {
         });
     }
 
+    private CipService getCipService(EipPacket response) {
+        if (response instanceof CipRRData rr
+            && rr.getStatus() == CIPStatus.Success.getValue()
+            && rr.getTypeIds().size() > 1
+            && rr.getTypeIds().get(1) instanceof UnConnectedDataItem di) {
+            return di.getService();
+        }
+        return null;
+    }
+
+    private CompletableFuture<Void> 
probeAttributesUsingSingleAttributeRequest() {
+        LOGGER.debug("Checking MessageRouter and ConnectionManager using 
GetAttributeSingle");
+
+        return 
checkAttributeSupport(CIPClassID.ConnectionManager).thenCompose(hasSupport -> {
+            useConnectionManager = hasSupport;
+            return checkAttributeSupport(CIPClassID.MessageRouter);
+        }).thenAccept(hasSupport -> {
+            useMessageRouter = hasSupport;
+        });
+    }
+
+    private CompletableFuture<Boolean> checkAttributeSupport(CIPClassID 
classId) {
+
+        UnConnectedDataItem exchange = new UnConnectedDataItem(new 
GetAttributeSingleRequest(
+            new LogicalSegment(new ClassID((byte) 0, (short) 
classId.getValue())),
+            new LogicalSegment(new InstanceID((byte) 0, (short) 0)), // Class 
level discovery
+            new LogicalSegment(new AttributeID((byte) 0, (short) 1))) // 
Attribute ID 1: Revision

Review Comment:
   I was using instanceId 1 at previous commit. I changed it after search and 
find out that 0 is used to discover. 
   Looks like the PLC LOGIX5573 supports message router and connection manager. 
When I test it using instanceId = 0 I receive the information that it support 
but does not when using instance = 1. So I believe instanceId = 0 is correct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to