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
+2 -2
View File
@@ -90,7 +90,7 @@ It prints the log, the 131-octet STATUS once a second (uptime, signing and radio
battery) and the first V2X_RX messages. Status exchange: the host sends `STATUS_REQUEST` every
1000 ms; `CONFIRM.detail` contains the snapshot.
Received messages reach the phone on two paths that both stay in the firmware: `V2X_RX` (ours, always on, already unwrapped, up to 494 octets) and `RAW_FRAME` (the spec's debug capture, on after `RAW_CAPTURE`, the whole radio frame, fragmented when large). The Android app has a switch for which one it consumes; the board always sends `V2X_RX`. See [NOTES.md](NOTES.md).
Received messages reach the phone on two paths that both stay in the firmware: `V2X_RX` (ours, always on, already unwrapped, one message up to 494 octets, fragmented above that up to 2300) and `RAW_FRAME` (the spec's debug capture, on after `RAW_CAPTURE`, the whole radio frame, fragmented when large). The Android app has a switch for which one it consumes; the board always sends `V2X_RX`. See [NOTES.md](NOTES.md).
```mermaid
flowchart LR
@@ -99,7 +99,7 @@ flowchart LR
Radio --> Unwrap[gn_unwrap.c: 802.11, LLC, GN, BTP, signature envelope]
Radio -->|only while RAW_CAPTURE is on| Cap[Raw capture tap: ITS5 record]
Stack -->|verified only| Ind[BTP_DATA_INDICATION 0x81]
Unwrap -->|always, signed or not, up to 494 octets| Rx[V2X_RX 0x90, MicrOBU]
Unwrap -->|always, signed or not, fragmented above 494 octets| Rx[V2X_RX 0x90, MicrOBU]
Cap -->|fragmented if large| Raw[RAW_FRAME 0x85, spec]
Ind --> Link[Station link: USB or BLE]
Rx --> Link