Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/alternate plc4 x 108 #59

Merged
merged 3 commits into from
Apr 23, 2019
Merged

Conversation

chrisdutz
Copy link
Contributor

Hi,

in this alternate implementation, I added a "ping" method to the default API and moved the code for the TCP ping into the classes actually involved in TCP (with options for other base types - serial, udp, raw-socket, test, ...).

Please review.

- Renamed the PlcConnection "parse" method to "prepareField"
- Added a "ping" method to the PlcConnection (which returns a CompletableFuture<Void>)
- Removed the getInetSocketAddress method
- Fixed two broken driver implementations (Dummy and Mock Driver)
- Implemented the "ping" method for different base types.
@JulianFeinauer
Copy link
Contributor

@chrisdutz thank you for the PR! I will try to review it this week and start some tests with our S7 PLC here, to see if it works.

@Override
public CompletableFuture<Void> ping() {
CompletableFuture<Void> future = new CompletableFuture<>();
future.completeExceptionally(new PlcUnsupportedOperationException("The connection does not support pinging"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh ... was looking for something like that ... strangely I must have missed it :-) ... of course ... will update that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! ... I knew there was something ... if I used the failedFuture method, we would have to bump up the Java level to 9 which I wasn't planning on doing just for this one convenience method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough. :)

@chrisdutz chrisdutz merged commit e5ca759 into develop Apr 23, 2019
@asfgit asfgit deleted the feature/alternate-PLC4X-108 branch April 23, 2019 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants