0
0
Fork 0

docs: Add BLE and UART protocol specification

This commit is contained in:
Jannik Beyerstedt 2026-05-15 15:17:04 +02:00
commit 29a5d86e43
4 changed files with 196 additions and 1 deletions

122
docs/c_its-messages.proto Normal file
View file

@ -0,0 +1,122 @@
syntax = "proto2";
package c_its_io;
// ------------------------------
// Data Types
// ------------------------------
message Position {
required float latitude_deg = 1;
required float longitude_deg = 2;
}
enum TrafficDir {
// for all directions of traffic
ALL_DIRECTIONS = 0;
// for the direction of traffic according to the reference direction, and the portion of traffic upstream of the reference position
UPSTREAM = 1;
// for the direction of traffic according to the reference direction, and the portion of traffic downstream of the reference position
DOWNSTREAM = 2;
// for the direction of traffic opposite to the reference direction
OPPOSITE = 3;
}
message VehicleContainer {
optional uint32 heading_deg = 1; // vehicle heading in degrees, if not "unavailable"
optional uint32 speed = 2; // vehicle speed in 1/100 m/s, if not "unavailable"
optional uint32 vehicle_length_dm = 3; // vehicle length in 1/10 m, if not "unavailable"
optional uint32 vehicle_width_dm = 4; // vehicle width in 1/10 m, if not "unavailable"
}
// GeoNetworking Destination Area Shape
enum GNAreaShape {
ETSI_AREASHAPE_CIRCLE = 0;
ETSI_AREASHAPE_RECTANGLE = 1;
ETSI_AREASHAPE_ELLIPSIS = 2;
ETSI_AREASHAPE_UNKNOWN = 15;
}
// GeoNetworking Destination Area/ Source Position
message ITSPosition {
optional int32 latitude = 1; // Latitude in 1/10th of micro degrees
optional int32 longitude = 2; // Longitude in 1/10th of micro degrees
}
// GeoNetworking Destination Area
message GNArea {
optional GNAreaShape area = 1 [default = ETSI_AREASHAPE_UNKNOWN];
optional ITSPosition position = 2;
optional int32 distA = 3; // Distance A of the geometric shape in meters
optional int32 distB = 4; // Distance B of the geometric shape in meters, mandatory for rectangle and ellipsis
optional int32 angle = 5; // Angle of the geometric shape in degrees, mandatory for rectangle and ellipsis
}
// GeoNetworking Transport
enum GNTransport {
GN_TRANSPORT_DEFAULT = 0;
GN_TRANSPORT_GUC = 2; // GeoUnicast
GN_TRANSPORT_GAC = 3; // Geographically-Scoped Anycast
GN_TRANSPORT_GBC = 4; // Geographically-Scoped broadcast
GN_TRANSPORT_TSB = 5; // Topologically-scoped broadcast
GN_TRANSPORT_SHB = 7; // Single hop broadcast
}
message RawMsgTx {
required bytes payload = 1; // as UPER
required uint32 message_type = 2; // ITS `MessageId` integer value
required GNTransport gnTransport = 3;
required GNArea gnArea = 4;
required uint32 hopLimit = 5;
}
// ------------------------------
// Messages
// ------------------------------
message PositionState {
required Position position = 1;
optional uint32 heading_deg = 2;
optional uint32 speed = 3; // speed in 1/100 m/s
}
message DenmEvent {
required fixed64 timestamp = 1; // DENM reference time as UNIX time
required fixed64 validity_end_ts = 2; // UNIX time when event validity ends (from denm.management.validityDuration)
required fixed32 station_id = 3; // unique ID of the event when combined with `seq_num`
required uint32 seq_num = 4; // unique ID of the event when combined with `station_id`
optional Position event_position = 5; // event location (from denm.management.eventPosition)
optional uint32 event_heading_deg = 6; // event heading (from denm.location.eventPositionHeading)
optional TrafficDir direction = 7; // relevance traffic direction (from denm.management.trafficDirection)
optional uint32 cause_code = 8;
optional uint32 sub_cause_code = 9;
}
message CamEvent {
required fixed32 station_id = 1; // Station ID of the vehicle
required uint32 station_type = 2; // ITS `StationType`
required Position position = 3; // vehicle position
optional uint32 vehicle_role = 4; // ITS `VehicleRole`
optional VehicleContainer vehicle_data = 5; // speed, etc unless CAM contains an RSU container
}
message RawMsgRx {
required uint32 msg_type = 1; // ITS message type (`MessageId` from PDU header)
required bytes payload = 2; // UPER message with Geonetworking and BTP headers
}
message SerialOutputMsg {
oneof payload {
DenmEvent denm = 1;
RawMsgRx rx_msg = 2;
}
}
message SerialInputMsg {
oneof payload {
PositionState position = 1;
RawMsgTx tx_msg = 2;
}
}