Files
adsb-tools/proto/adsb.proto

69 lines
1.9 KiB
Protocol Buffer
Raw Normal View History

2016-02-23 15:19:56 -08:00
message AdsbHeader {
2016-02-28 19:59:04 -08:00
// Always "aDsB"
2016-02-23 15:19:56 -08:00
required string magic = 1;
2016-02-28 19:59:04 -08:00
// Unique identifier for this server implementation
// Recommended: "https://url/of/source#version"
2016-02-23 15:19:56 -08:00
required string server_version = 2;
2016-02-28 19:59:04 -08:00
// Unique identifier for this server instance
// UUID recommended
// 36 character limit
2016-02-23 15:19:56 -08:00
required string server_id = 3;
2016-02-28 19:59:04 -08:00
// MHz of the clock used in subsequent mlat_timestamp fields
2016-02-23 15:19:56 -08:00
required fixed32 mlat_timestamp_mhz = 4;
2016-02-28 19:59:04 -08:00
// Maximum value of subsequent mlat_timestamp fields, at which point values are expected to wrap
2016-02-23 15:19:56 -08:00
required fixed64 mlat_timestamp_max = 5;
2016-02-28 19:59:04 -08:00
// Maximum value of subsequent rssi fields
2016-02-23 15:19:56 -08:00
required fixed32 rssi_max = 6;
}
message AdsbPacket {
2016-02-28 19:59:04 -08:00
// Unique value for the source that recorded this packet
// UUID recommended
// 36 character limit
2016-02-23 15:19:56 -08:00
required string source_id = 1;
2016-02-28 19:59:04 -08:00
// Number of routing hops since source, when carried by protocols with a hop count.
required uint32 hops = 2;
2016-02-28 19:59:04 -08:00
// Value of the MLAT counter when this packet arrived at the recorder
// Range [0, mlat_timestamp_max]
// Units of 1 / (mlat_timestamp_mhz * 10^6) Hz
optional fixed64 mlat_timestamp = 3;
2016-02-28 19:59:04 -08:00
// RSSI of the received packet at the recorder
// Range [0, rssi_max]
// Units unspecified
optional fixed32 rssi = 4;
2016-02-28 19:59:04 -08:00
// Binary packet payload.
// Length:
// mode_ac: 2 bytes
// mode_s_short: 7 bytes
// mode_s_long: 14 bytes
required bytes payload = 5;
2016-02-23 15:19:56 -08:00
}
message Adsb {
2016-02-28 19:59:04 -08:00
// Each message must contain exactly one; zero is invalid.
// The first record of a stream must be a header.
// Subsequent records may be in any order, including additional headers.
2016-02-23 15:19:56 -08:00
oneof record {
AdsbHeader header = 1;
AdsbPacket mode_ac = 2;
AdsbPacket mode_s_short = 3;
AdsbPacket mode_s_long = 4;
2016-02-23 15:19:56 -08:00
}
}
2016-02-28 19:59:04 -08:00
// adsbus proto serialization takes advantage of the fact that an AdsbStream
// with many messages and many AdsbStreams each with a single message encode
// identically.
message AdsbStream {
repeated Adsb msg = 1;
}