Skip to content

Consider hopStart=0 when calculating hops for packets#4101

Merged
jamesarich merged 2 commits into
meshtastic:mainfrom
esev:0HopStart
Dec 31, 2025
Merged

Consider hopStart=0 when calculating hops for packets#4101
jamesarich merged 2 commits into
meshtastic:mainfrom
esev:0HopStart

Conversation

@esev

@esev esev commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

Consider packets transmitted with 0 hops when calculating the hops for a packet. This is a follow-on to meshtastic/firmware#9120 for the Android app.

Prior to firmware v2.3.0 nodes did not provide a hop_start in packets. This meant that receiving a hop_start value of 0 could mean two different things; either the node was older and didn't supply a hop_start, or the transmitting node had LoRa number of hops set to 0. This PR uses the presence of the bitfield, added in v2.5.0, to distinguish between these two cases.

When hop_start=0 and the bitfield is present, we can trust that the transmitting node had LoRa number of hops set to 0. getHopsAwayForPacket considers the presence of the bitfield, and returns 0 for the number of hops away in this case.

@codecov

codecov Bot commented Dec 31, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (21ec78d) to head (f32b28f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4101   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          2       2           
  Lines         19      19           
  Branches       7       7           
=====================================
  Misses        19      19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@esev esev marked this pull request as ready for review December 31, 2025 06:58
@jamesarich jamesarich added the enhancement New feature or request label Dec 31, 2025
@jamesarich jamesarich added this pull request to the merge queue Dec 31, 2025
Merged via the queue into meshtastic:main with commit a0910df Dec 31, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants