sruehl commented on code in PR #1376:
URL: https://github.com/apache/plc4x/pull/1376#discussion_r1477996368


##########
plc4j/drivers/firmata/src/main/java/org/apache/plc4x/java/firmata/readwrite/protocol/FirmataProtocolLogic.java:
##########
@@ -71,12 +71,22 @@ public void onConnect(ConversationContext<FirmataMessage> 
context) {
         LOGGER.debug("Sending Firmata Reset Command");
         FirmataMessageCommand resetCommandMessage = new 
FirmataMessageCommand(new FirmataCommandSystemReset());
         context.sendRequest(resetCommandMessage)
+            .onTimeout(e -> {
+                LOGGER.info("Timeout during Connection establishment, closing 
channel...");
+            })
+            .onError((firmataMessage, throwable) -> {
+                LOGGER.error("Error during Connection establishment. Got: {}", 
firmataMessage.toString(), throwable);
+            })
+            // Technically the remote will send two messages, one containing 
only the version information,
+            // the second one also containing the name of the remote station. 
We simply wait for the
+            // second one and silently have the decode method drop the first.
             .expectResponse(FirmataMessage.class, REQUEST_TIMEOUT)
-            .only(FirmataMessageCommand.class)

Review Comment:
   was there a problem with the `only`?



-- 
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: dev-unsubscr...@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to