Forward MAPEM and VAM from the ESP32-C5, and add a bench listener

gn_unwrap.c now passes BTP ports 2003 (MAPEM) and 2018 (VAM), signed or
not, besides CAM, DENM and SPATEM. A message over 494 bytes still does not
fit one 512-octet link message (also the largest GATT value) and is dropped
and counted, not fragmented. The bench RSU's MAPEM is 295 bytes.

CONFIG_MICROBU_BENCH_LISTEN (off in sdkconfig) is for a board whose only PC
connection is the UART0 console: it configures itself receive-only at boot
and logs every V2X_RX message; tools/bench_listen_watch.py tallies the log.
On air on 2026-10-28 it forwarded 104 MAPEM, 185 SPATEM and 472 CAM in
90 s, with nothing oversize. The RSU sent all of them unsigned.

Host tests: signed GeoBroadcast SPATEM/MAPEM frames of 58 to 1243 bytes
with every truncation length; the replay cuts frames at c5_radio.cpp's
2346 bytes (not the old C firmware's 800) and checks MAPEMs with asn1tools.
This commit is contained in:
Ashin Walpola
2026-10-28 16:48:37 +01:00
parent 9f77f9f0e4
commit fc3354a4ba
12 changed files with 246 additions and 55 deletions
+16 -5
View File
@@ -55,11 +55,22 @@ Settings > Developer > V2X data logger. 110 unit tests pass. ESP32-C5 path check
- [ ] **CiT One:** same, `source='cit_one'`, `rssi_dbm` NULL, `obu_*` filled from `v2x/rx/obu_gnss`.
Expect both `channel='raw'` and `channel='processed'` rows for the same CAM.
- [ ] **Screen off for a few minutes** with the log running: rows keep arriving (foreground service).
- [ ] **MAPEM and VAM on the ESP32-C5 need a firmware change.** `gn_unwrap.c` accepts only BTP ports
2001, 2002, 2004; add 2003 (MAPEM) and 2018 (VAM) and reflash. Real MAPEMs are mostly over the
512-byte link limit, so most will still be counted as oversize drops. The app side already logs
any port. On the CiT One, MAPEM arrives via `v2x/rx/mapem` (subscribed now) or the processed
`v2x-uca/output/json/map` topic; the API lists no VAM topic, so no VAM rows are expected there.
- [ ] **MAPEM and VAM on the ESP32-C5.** Firmware side done 2026-10-28: `gn_unwrap.c` accepts 2003
(MAPEM) and 2018 (VAM), signed or not. The bench RSU's MAPEM is 295 bytes and fits; real
road MAPEMs over 494 bytes are still dropped as oversize (no fragmentation). On air with the
bench listener on COM3 (`tools/bench_listen_watch.py COM3 90`): 104 MAPEM (295 B, GBC), 185
SPATEM (58 B), 472 CAM in 90 s, 0 oversize. COM10 app-flashed 2026-10-28 (d0fcb45-dirty, NVS
kept; STATUS 106 octets, 3999 mV). BLE reconnected to the Pixel on the bond it already had
(16:38, bond state 12, ATT MTU 517, credentials loaded, 1 ticket). Still to do (RSU off): a V2X
log shows `MAPEM` rows with `source='esp32'`. App side: `CamUseCaseRepository` logs "unexpected BTP
port" for 2003/2018 (no decoder there yet). On the CiT One, MAPEM arrives via `v2x/rx/mapem` (subscribed now) or
the processed `v2x-uca/output/json/map` topic; the API lists no VAM topic, so no VAM rows are
expected there.
- [ ] **Signed SPATEM/MAPEM on air.** On 2026-10-28 the bench RSU sent CAM, SPATEM and MAPEM all
unsigned, so the signed path for these two is checked on the host only (`test_secured_gbc`
in `test_chain.c`; the envelope code is the one real signed CAMs and GBC DENMs pass). Once the
RSU signs: `bench_listen_watch.py COM3 60` must show the `signed` column equal to `count` for
ports 2003 and 2004.
### Signed-TX firmware (vanetza-idf port), VAM and BLE: first on-air checks (added 2026-09-23)