Replies: 2 comments 2 replies
-
Is it possible, that this was a relic from the PROFINET driver, where you initially executed a discovery in order to connect, which I replaced with an explicit connection and therefore this is no longer needed? |
Beta Was this translation helpful? Give feedback.
-
I think it was initially a way to get the driver to go through the discover process and wait for it to be finished before opening a connection. It was used in the opcua driver, I think, to get a list of endpoints which are then compared with the endpoint given by the plc4x address string. It was initially called awaitSessionDiscoverComplete, but then got split into two different parameters awaitSessionDiscoverComplete and fireDiscoverEvent. Looking at the code awaitSessionDiscoverComplete seems to require fireDiscoverEvent to be set for this functionality to work. |
Beta Was this translation helpful? Give feedback.
-
Hi all and especially @hutcheb ,
I am currently playing around with implementing Ping operations for all drivers and was going through the code.
There I noticed a type of event "DiscoverEvent" which felt slightly odd.
In the end I noticed that there's a "fireDiscoveryEvent()" method in GeneratedDriverBase and it's implemented to return "false". However it seems as if this is never overridden anywhere ... so it seems as if this always returns "false" for all drivers.
Therefore the code block in DefaultNettyPlcConnection.connect() is also never executed.
I am pretty sure there was a reason for adding this event and code ... but it also seems this doesn't exist anymore.
My question now is:
Is it ok to remove the Event and the event-handling code?
Chris
Beta Was this translation helpful? Give feedback.
All reactions