Fragment large V2X_RX messages and decode road-RSU SPATEMs

The firmware dropped every received ITS message over 494 bytes (one link
message), so a road RSU's 888-byte SPATEM and 1198-byte MAPEM never reached
the phone. V2X_RX now goes out in link fragments up to 2300 bytes, best
effort and non-blocking; messages up to 494 bytes are unchanged.

The app's SPATEM decoder then refused those messages because they carry
intersection and movement names and advisory speed lists. It now reads past
both, checked against asn1tools on 718 distinct messages.

Adds the pure fragmenter with host tests and a pcap replay, a Kotlin
cross-check on the firmware's own fragments, tools/rx_size_compare.py,
docs/08-large-message-reception.md and station-link revision 3.
This commit is contained in:
Ashin Walpola
2026-11-23 17:34:56 +01:00
parent 7dd83dba3d
commit ce18a393ea
24 changed files with 3305 additions and 2305 deletions
+7 -7
View File
@@ -52,13 +52,13 @@
// only this path). Other ports are dropped. The link message itself is generic: the port says what
// the payload is.
//
// Size caveat: a link message is at most 512 octets (link::maximum_message, which is also the
// largest GATT attribute value), so Station::forward_raw() drops a message whose UPER exceeds
// 494 bytes and counts it as oversize instead of forwarding it. Nothing is fragmented. The bench
// RSU's messages all fit (2026-10-28 capture: SPATEM 58, MAPEM 295 bytes); real road SPATEMs and
// MAPEMs often do not (SPATEM 555 bytes median, 1243 max on the 2026-03-18 drive). The radio
// itself captures frames of up to 2346 bytes (c5_radio.cpp), so `truncated` does not happen on
// this firmware.
// Size: a link message is at most 512 octets (link::maximum_message, which is also the largest
// GATT attribute value), so a UPER up to 494 bytes goes to the phone as one V2X_RX message. A larger
// one (real road SPATEMs and MAPEMs: SPATEM 555 bytes median, 1243 max on the 2026-03-18 drive;
// the 2026-11-23 bench node sent 888 and 1198) is sent by Station::forward_raw() in link fragments,
// see v2x_rx.hpp (v2x_rx_plan) and link_fragment.hpp. Only a message beyond v2x_rx_max_forward is
// dropped and counted as oversize. The radio itself captures frames of up to 2346 bytes
// (c5_radio.cpp), so `truncated` does not happen on this firmware.
//
// No FCS/CRC check here: the WiFi driver has already validated the frame.
typedef struct {