fix: migrate OhmSender TIpAddress comparisons to TIpAddressUtils#8
Open
kylegordon wants to merge 2 commits into
Open
fix: migrate OhmSender TIpAddress comparisons to TIpAddressUtils#8kylegordon wants to merge 2 commits into
kylegordon wants to merge 2 commits into
Conversation
ohNet 1.40 changed TIpAddress from a typedef'd uint32 to a struct (iFamily + iV4/iV6) to support IPv6 adapters. Direct comparisons against 0 and between TIpAddress values (operator!=), and passing a raw TUint32 to Endpoint::SetAddress()/WriteUint32Be(), no longer compile. Replace with TIpAddressUtils::IsZero()/Equals() and build TIpAddress values explicitly, matching the migration ohNet itself made to its own call sites.
ohNet 1.40 changed TIpAddress from a typedef'd uint32 to a struct (iFamily + iV4/iV6). HandleSlave() directly initialised a TIpAddress from the raw TUint read off the wire, which no longer compiles against the new struct type. Read the raw value separately and build the TIpAddress explicitly, matching the migration already applied to OhmSender.cpp in this PR.
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.
Summary
ohNet 1.40 changed
TIpAddressfrom atypedef'duint32to a struct (iFamily+iV4/iV6) to support IPv6 adapters.OhmSender.cppstill comparedTIpAddressvalues with!= 0/operator!=and passed a rawTUint32toEndpoint::SetAddress()/WriteUint32Be(), none of which compile against the new struct type.This mirrors the migration ohNet itself made at its own call sites: replace direct comparisons with
TIpAddressUtils::IsZero()/TIpAddressUtils::Equals(), and buildTIpAddressvalues explicitly where a raw address integer was being passed around.Companion fix to #7 (
kMaxUriBytes) — both are needed to build ohSongcast against ohNet 1.40.Test plan
operator!=/SetAddressoverload-resolution errors onTIpAddress)