Drop C++ standard to C++17 and add multicast T2O support#125
Open
chace219 wants to merge 5 commits into
Open
Conversation
Upstream sets CMAKE_CXX_STANDARD 20, which the SDK cross toolchain (arm-rockchip830-linux-uclibcgnueabihf-g++ 8.3.0) cannot compile. The codebase uses no C++20-only features, so dropping to C++17 is a clean change. A bare set() in CMakeLists also overrides -DCMAKE_CXX_STANDARD from the buildroot package, so the source must carry the standard. Cross-compiled clean (lib + all examples incl. implicit_messaging) for ARM with GCC 8.3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
EIPScanner previously only set up a unicast T2O receive socket
(findOrCreateSocket bound to host:2222), ignoring T2O_SOCKADDR_INFO. So
adapters that produce inputs to a multicast group were never received and
the scanner fell back to / required point-to-point.
This adds multicast T2O receive:
- UDPBoundSocket::joinMulticastGroup() — IP_ADD_MEMBERSHIP on the bound
socket; IP_DROP_MEMBERSHIP in the destructor.
- ConnectionManager parses T2O_SOCKADDR_INFO from the Forward_Open
response; if the advertised T2O address is multicast (224/4) it
creates a group-joined receive socket, else unicast (unchanged).
- Shared receive handler (attachIoReceiveHandler) demuxes by T2O
connection id for both unicast and multicast sockets.
Selectable per connection by the originator requesting MULTICAST vs P2P
t2o network connection params. Cross-compiles C++17/GCC 8.3 for ARM.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Binding the multicast receive socket to INADDR_ANY:2222 alongside the unicast receive socket on the same port made unicast-vs-multicast delivery ambiguous in mixed deployments. Add a bindToGroup option to UDPBoundSocket and bind the multicast socket to the group address so it only receives that group's datagrams; unicast still binds INADDR_ANY. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Collaborator
|
Hi, nowadays I am far from the maintainer, but I did take a quick look at your first commit. Unfortunately MSVC doesn't support designated initializers before C++20: which is why it was bumped to C++20 in the first place: 7df05f1 |
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.
This pull request adds support for receiving I/O data over multicast UDP in addition to unicast, making the library compatible with EtherNet/IP devices that use multicast for T2O (Target-to-Originator) connections. The changes include detection of multicast addresses, correct socket binding and group joining, handler refactoring, and documentation updates. The C++ standard is also downgraded from C++20 to C++17 for compatibility with the Luckfox/RV1106 SDK toolchain.
Multicast I/O support:
Added detection of multicast addresses and logic to join multicast groups for T2O (Target-to-Originator) I/O data, including new methods
findOrCreateMulticastSocket,attachIoReceiveHandler, and the use ofjoinMulticastGroupinConnectionManager.cppandUDPBoundSocket. This allows the library to receive multicast I/O packets as required by some EtherNet/IP devices. [1] [2] [3] [4] [5]Refactored socket receive handler logic to improve clarity and robustness, including checks for malformed packets and clearer separation of handler attachment.
Platform and portability improvements:
Build and documentation updates:
CMakeLists.txtand updated theREADME.mdto reflect this, ensuring compatibility with GCC 8.3 and the Luckfox/RV1106 SDK. [1] [2]