mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-19 17:22:59 +00:00
PROTOCOL CHANGE! activate 32 bit nodenums/packetids
This commit is contained in:
@@ -56,8 +56,11 @@ PacketId generatePacketId()
|
||||
|
||||
if (!didInit) {
|
||||
didInit = true;
|
||||
i = random(0, numPacketId +
|
||||
1); // pick a random initial sequence number at boot (to prevent repeated reboots always starting at 0)
|
||||
|
||||
// pick a random initial sequence number at boot (to prevent repeated reboots always starting at 0)
|
||||
// Note: we mask the high order bit to ensure that we never pass a 'negative' number to random
|
||||
i = random(numPacketId & 0x7fffffff);
|
||||
DEBUG_MSG("Initial packet id %u, numPacketId %u\n", i, numPacketId);
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user