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
+8 -1
View File
@@ -22,7 +22,14 @@ Changed or added for this project (search for `MicrOBU:` in the sources):
than the provisioned demo root (every RSU). Every captured frame therefore also goes through the
previous firmware's `gn_unwrap.c` and reaches the phone as link opcode `V2X_RX` (0x85), whose body
is exactly the old `SERIAL_MSG_V2X_RX` payload (`Station::forward_raw`). The app's receive side is
unchanged.
unchanged. Signed or not, BTP ports 2001 CAM, 2002 DENM, 2003 MAPEM, 2004 SPATEM and 2018 VAM
pass (MAPEM and VAM since 2026-10-28); a message over 494 bytes does not fit a 512-octet link
message and is dropped and counted, not fragmented.
- **Bench listener** (`CONFIG_MICROBU_BENCH_LISTEN`, off in `sdkconfig`): for a board whose only PC
connection is the UART0 console. It configures itself receive-only at boot and logs every V2X_RX;
`tools/bench_listen_watch.py COMx` tallies the log. Build it from a copy of `sdkconfig` with the
option on and `CONFIG_MICROBU_BATTERY_ADC_GPIO=-1` (on a board without the XIAO's cell divider,
GPIO6 floats and can read like a flat cell, which deep-sleeps the board), e.g. `idf.py -B build-bench -DSDKCONFIG=<copy> build`.
- **Unsigned transmission is still possible.** The colleague's station refuses unsecured requests.
Here a request with GN security profile 1 goes out with the previous firmware's `geonet.c` header
and the position of the last PoTi (`Station::unsecured_request`); the app's "Sign outgoing