switched to modbus_new_tcp_pi - #50
Open
v-zhuravlev wants to merge 4 commits into
Open
Conversation
v-zhuravlev
force-pushed
the
dns
branch
14 times, most recently
from
September 24, 2018 09:53
48274bc to
ec48acc
Compare
Owner
Author
|
DNS is now supported in both TCP and RTU over TCP modes. Latter is supported thanks to @myssta version of the patch I merged into v-zhuravlev/libmodbus. |
i-ky
requested changes
Sep 25, 2018
| TCP port may also be redefined (from Modbus default 502) if needed: `enc://192.168.1.1:5000` | ||
|
|
||
| Note: DNS names are not supported for TCP and RTU over TCP | ||
| TCP port may also be redefined (from Modbus default 502) if needed: `enc://192.168.1.1:5000` |
|
|
||
| char host[100]; | ||
| int port = MODBUS_TCP_DEFAULT_PORT; | ||
| char port_str[10]; |
Collaborator
There was a problem hiding this comment.
sprintf()ing MAX_INT can overflow this buffer.
| { | ||
| *lock_required_out = 1; | ||
| con_string += strlen("enc://"); | ||
| sscanf(con_string, "%99[^:]:%99d[^\n]", host, &port); |
Collaborator
There was a problem hiding this comment.
Why don't we just read port as %s?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
would implement #48 when done