Advertise repeat capability via FEAT1 flags#1909
Open
wbijen wants to merge 1 commit intomeshcore-dev:devfrom
Open
Advertise repeat capability via FEAT1 flags#1909wbijen wants to merge 1 commit intomeshcore-dev:devfrom
wbijen wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4f00d2c to
2ede14e
Compare
Contributor
|
Please see meshcore-dev/meshcore.js#17 |
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
Implements #1906 — nodes that forward packets but aren't dedicated repeaters (room servers with repeat enabled, companions with
client_repeat) can now advertise this via a bitmask in the existing FEAT1 advert field.This helps companion apps distinguish relay-capable nodes in path displays and resolves hash collisions where a room server was being confused with a repeater (as reported in #1866 and #1707).
What changed
ADVERT_CAP_REPEAT(0x0001) — first bit in the FEAT1 bitmask, meaning "this node forwards packets".buildAdvertData()andcreateSelfAdvert()gain an optionalfeat1parameter (default 0, no extra bytes on wire).ADVERT_CAP_REPEATwhen repeat is enabled (!disable_fwd).ADVERT_CAP_REPEATwhenclient_repeatis on (3 call sites: manual advert, self-export, periodic advert).ADVERT_CAP_REPEATfor consistency, even thoughADV_TYPE_REPEATERalready implies it.The generic FEAT1 naming is kept intentionally — the 16-bit field carries different kinds of information (capabilities, flags, properties) depending on context, so a neutral name fits better than something specific.
Backwards compatibility
Fully backwards compatible in both directions:
ADV_FEAT1_MASKbit simply skip the 2-byte field (already wired up in the parser).feat1 = 0, so the field is omitted from the wire — no extra bytes.Future FEAT1 bits
The uint16_t bitmask has 15 bits remaining. Some candidates:
ADVERT_FLAG_OPEN_ROOMADVERT_FLAG_READONLYallow_read_onlyenabled — apps could indicate guest access is availableThese don't have concrete firmware/app consumers yet, so they're not included — just noted for future reference.
Test plan
heltec_v4_companion_radio_usbheltec_v4_room_serverheltec_v4_repeaterheltec_v4_sensor(unchanged, still passesfeat1 = 0via default)client_repeaton → advert includes FEAT1 field with 0x0001