mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(mesh): Set hopStart to match hopLimit in sent packets (#4324)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
4cfd8777a6
commit
2b6c3185b0
2 changed files with 27 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ constructor(
|
|||
sessionPasskey.set(key)
|
||||
}
|
||||
|
||||
private fun getHopLimit(): Int = localConfig.value.lora.hopLimit.takeIf { it > 0 } ?: DEFAULT_HOP_LIMIT
|
||||
private fun computeHopLimit(): Int = localConfig.value.lora.hopLimit.takeIf { it > 0 } ?: DEFAULT_HOP_LIMIT
|
||||
|
||||
private fun getAdminChannelIndex(toNum: Int): Int {
|
||||
val myNum = nodeManager?.myNodeNum ?: return 0
|
||||
|
|
@ -147,7 +147,7 @@ constructor(
|
|||
newMeshPacketTo(p.to ?: DataPacket.ID_BROADCAST).buildMeshPacket(
|
||||
id = p.id,
|
||||
wantAck = p.wantAck,
|
||||
hopLimit = if (p.hopLimit > 0) p.hopLimit else getHopLimit(),
|
||||
hopLimit = if (p.hopLimit > 0) p.hopLimit else computeHopLimit(),
|
||||
channel = p.channel,
|
||||
) {
|
||||
portnumValue = p.dataType
|
||||
|
|
@ -395,7 +395,9 @@ constructor(
|
|||
): MeshPacket {
|
||||
this.id = id
|
||||
this.wantAck = wantAck
|
||||
this.hopLimit = if (hopLimit > 0) hopLimit else getHopLimit()
|
||||
val actualHopLimit = if (hopLimit > 0) hopLimit else computeHopLimit()
|
||||
this.hopLimit = actualHopLimit
|
||||
this.hopStart = actualHopLimit
|
||||
this.priority = priority
|
||||
|
||||
if (channel == DataPacket.PKC_CHANNEL_INDEX) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue