Set last byte to 0xFF if it ended at 0x00

As per an idea of @S5NC
This commit is contained in:
GUVWAF
2023-11-27 20:36:48 +01:00
parent 81f57b65e1
commit ef2c6eed05
5 changed files with 13 additions and 10 deletions

View File

@@ -824,10 +824,10 @@ void NodeDB::updateFrom(const meshtastic_MeshPacket &mp)
// If this packet didn't travel any hops, then it was sent directly to us, so we know what to use as next hop to this node
if (mp.original_hop_limit == mp.hop_limit) {
info->next_hop = (uint8_t)(mp.from & 0xFF);
info->next_hop = getLastByteOfNodeNum(mp.from);
} else if (mp.relay_node && (mp.original_hop_limit - mp.hop_limit == 1)) {
// This packet traveled one hop, so we can use the relay_node as next_hop
info->next_hop = (uint8_t)(mp.relay_node & 0xFF);
info->next_hop = getLastByteOfNodeNum(mp.relay_node);
}
}
}