0
0
Fork 0

WIP: Enable BLE

TODO: Receive from BLE
This commit is contained in:
Jannik Beyerstedt 2026-05-11 21:08:23 +02:00 committed by Jannik Beyerstedt
commit fd8f28ef33
8 changed files with 741 additions and 10 deletions

View file

@ -35,15 +35,65 @@ All data types are defined in one `.proto` file: [c_its-messages.proto](./c_its-
When there's no GNSS receiver connected to the ESP, position, heading and speed information can be set using a `PositionState` message (see [c_its-messages.proto](./c_its-messages.proto)).
Maximum message size (assuming realistic value ranges):
field name | tag size | (max.) data size
----------------- | -------- | ---------
timestamp_ms | 1 | 8 (I64)
position | 1 | 1 (LEN(10)) + sub-fields below
\+ latitude_deg | 1 | 4 (I32)
\+ longitude_deg | 1 | 4 (I32)
heading | 1 | 2 (VARINT(3600))
speed | 1 | 2 (VARINT(~163 m/s))
**SUM** | 6 + | 21 = 27 byte
### DENM Event
Each received DENM will be "published" as a `DenmEvent` message (see [c_its-messages.proto](./c_its-messages.proto)).
Repetitions of the same message (e.g. no changes to the validity timeframe and location) may be dropped by the BLE server.
Maximum message size (assuming realistic value ranges):
field name | tag size | (max.) data size
----------------- | -------- | ---------
timestamp | 1 | 8 (I64)
validity_end_ts | 1 | 8 (I64)
station_id | 1 | 8 (I64)
seq_num | 1 | 3 (VARINT(65535))
event_position | 1 | 1 (LEN(10)) + sub-fields below
\+ latitude_deg | 1 | 4 (I32)
\+ longitude_deg | 1 | 4 (I32)
event_heading_deg | 1 | 1 (VARINT(360))
direction | 1 | 1 (VARINT(3))
cause_code | 1 | 1 (VARINT(127))
sub_cause_code | 1 | 1 (VARINT(127))
**SUM** | 11 + | 40 = 51 byte
Note: Cause code and sub-cause code are technically 0..255 in the ASN.1 spec, but that's mainly to ensure backwards-compatibility of the CHOICE with the old wire format.
Realistically only cause codes up to 100 are defined and common sub-cause codes use values up to 22.
### CAM Event
Each received (low-frequency) CAM will be "published" as a `CamEvent` message (see [c_its-messages.proto](./c_its-messages.proto)).
Maximum message size (assuming realistic value ranges):
field name | tag size | (max.) data size
--------------------- | -------- | ---------
station_id | 1 | 8 (I64)
station_type | 1 | 1 (VARINT(15))
position | 1 | 1 (LEN(10)) + sub-fields below
\+ latitude_deg | 1 | 4 (I32)
\+ longitude_deg | 1 | 4 (I32)
vehicle_role | 1 | 1 (VARINT(15))
vehicle_data | 1 | 1 (LEN(11)) + sub-fields below
\+ heading_deg | 1 | 2 (VARINT(360))
\+ speed | 1 | 2 (VARINT(~163 m/s))
\+ vehicle_length_dm | 1 | 2 (VARINT(1023))
\+ vehicle_width_dm | 1 | 1 (VARINT(62))
**SUM** | 11 + | 27 = 38 byte
### Raw Received Message
Received V2X messages will be "published" as a `RawMsgRx` message (see [c_its-messages.proto](./c_its-messages.proto)).