Files
firmware/src/platform
Jonathan BennettandClaude Opus 5 faca3727de Let a module ask for a parity of the CSMA backoff slot grid, and let DMShell use it
Two nodes exchanging a stream are each other's main collision partner: both redraw
their backoff after the same frame, and land on the same slot far more often than
chance, because the draw is timed from each node's own handling of that frame rather
than from the frame itself.

A module can now claim a packet for one parity of the slot grid through
RadioTxHook::slotParity(), returning the new meshtastic.SlotParity from mesh.proto.
A claimed packet's plain CSMA draw counts its slots from the air end of the last
frame this node sent or heard - the one instant both ends share - and takes only
slots of that parity, so two nodes on opposite parities are always at least a whole
slot apart however differently they handled the frame. The weighted rebroadcast draw
is untouched, and with no parity claimed the draw is exactly the code that was there.

The driver keeps the anchor up to date whether or not anything asks for it: the air
end is stamped in the TX_DONE / RX_DONE interrupt itself, since everything after that
is handling delay a peer does not share.

DMShell claims its own frames when DMSHELL_SLOT_PARITY=even|odd is set, by packet id
rather than port number, since the packet is encrypted by the time the driver asks.
Unset, no hook is registered at all. -DMESHTASTIC_TX_SLOT_PARITY=<0|1> gives a whole
node a default parity, for the far end of a session that runs no module of its own.

The mesh.proto enum needs its own protobufs PR and a submodule bump; the generated
files here were regenerated from it with nanopb 0.4.9.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MkrqYBzhAxyybmoezb1TJV
2026-10-10 15:25:13 +00:00
..
2026-09-24 22:41:37 +00:00