2016-02-28 18:56:37 -08:00
|
|
|
# JSON protocol
|
|
|
|
|
|
|
|
|
|
This protocol was created by adsb-tools. This specification is official.
|
|
|
|
|
|
|
|
|
|
## Format
|
|
|
|
|
|
|
|
|
|
[JSON streaming](https://en.wikipedia.org/wiki/JSON_Streaming) encoding, line delimited.
|
2016-02-28 19:02:12 -08:00
|
|
|
Each line must contain a single outer JSON object; no other outer types are permitted.
|
2016-02-28 18:56:37 -08:00
|
|
|
|
|
|
|
|
First frame must always be a header; frames can otherwise appear in any order, including
|
|
|
|
|
additional headers.
|
|
|
|
|
|
|
|
|
|
## Common fields
|
|
|
|
|
* `type` (string): one of:
|
2016-02-28 20:05:02 -08:00
|
|
|
* `"header"` (see [Header](#header))
|
|
|
|
|
* `"Mode-AC"` (see [Packet](#packet))
|
|
|
|
|
* `"Mode-S short"` (see [Packet](#packet))
|
|
|
|
|
* `"Mode-S long"` (see [Packet](#packet))
|
2016-02-28 18:56:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
## Header
|
2016-02-28 20:03:25 -08:00
|
|
|
* `type`:
|
|
|
|
|
* String
|
2016-02-28 20:05:02 -08:00
|
|
|
* `"header"`
|
2016-02-28 20:03:25 -08:00
|
|
|
* `magic`:
|
|
|
|
|
* String
|
2016-02-28 20:05:02 -08:00
|
|
|
* `"aDsB"`
|
2016-02-28 20:03:25 -08:00
|
|
|
* `server_version`:
|
|
|
|
|
* String
|
|
|
|
|
* Unique identifier for this server implementation
|
2016-02-28 20:05:02 -08:00
|
|
|
* Recommended: `"https://url/of/source#version"`
|
2016-02-28 20:03:25 -08:00
|
|
|
* `server_id`:
|
|
|
|
|
* String
|
|
|
|
|
* Unique identifier for this server instance
|
|
|
|
|
* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) recommended
|
|
|
|
|
* 36 character limit
|
|
|
|
|
* `mlat_timestamp_mhz`:
|
|
|
|
|
* Integer
|
|
|
|
|
* MHz of the clock used in subsequent `mlat_timestamp` fields
|
|
|
|
|
* `mlat_timestamp_max`:
|
|
|
|
|
* Integer
|
|
|
|
|
* Maximum value of subsequent `mlat_timestamp` fields, at which point values are expected to wrap
|
|
|
|
|
* `rssi_max`:
|
|
|
|
|
* Integer
|
|
|
|
|
* Maximum value of subsequent `rssi` fields
|
2016-02-28 18:56:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
## Packet
|
2016-02-28 20:03:25 -08:00
|
|
|
* `type`:
|
|
|
|
|
* String
|
|
|
|
|
* One of:
|
2016-02-28 20:05:02 -08:00
|
|
|
* `"Mode-AC"` (4 byte payload, 2 bytes when decoded)
|
|
|
|
|
* `"Mode-S short"` (14 byte payload, 7 bytes when decoded)
|
|
|
|
|
* `"Mode-S long"` (28 byte payload, 14 bytes when decoded)
|
2016-02-28 20:03:25 -08:00
|
|
|
* `source_id`:
|
|
|
|
|
* String
|
|
|
|
|
* Unique value for the source that recorded this packet.
|
|
|
|
|
* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) recommended
|
|
|
|
|
* 36 character limit
|
|
|
|
|
* `mlat_timestamp`:
|
|
|
|
|
* Integer
|
|
|
|
|
* Value of the [MLAT](https://en.wikipedia.org/wiki/Multilateration) counter when this packet arrived at the recorder
|
|
|
|
|
* Range [0, `mlat_timestamp_max`]
|
|
|
|
|
* Units of 1 / (`mlat_timestamp_mhz` * 10^6) Hz
|
|
|
|
|
* `rssi`:
|
|
|
|
|
* Integer
|
|
|
|
|
* [RSSI](https://en.wikipedia.org/wiki/Received_signal_strength_indication) of the received packet at the recorder
|
|
|
|
|
* Range [0, `rssi_max`]
|
|
|
|
|
* Units unspecified
|
|
|
|
|
* `payload`:
|
|
|
|
|
* Upper-case, hex-encoded
|
|
|
|
|
* See `type` for length
|
2016-02-28 18:56:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
* `{"mlat_timestamp_mhz": 120, "type": "header", "magic": "aDsB", "server_version": "https://github.com/flamingcowtv/adsb-tools#1", "server_id": "fba76102-c39a-4c4e-af7c-ddd4ec0d45e2", "mlat_timestamp_max": 9223372036854775807, "rssi_max": 4294967295}\n`
|
|
|
|
|
* `{"payload": "02C58939D0B3C5", "type": "Mode-S short", "rssi": 269488144, "source_id": "f432c867-4108-4927-ba1f-1cfa71709bc4", "mlat_timestamp": 247651683709560}\n`
|
|
|
|
|
* `{"payload": "A8000B0B10010680A600003E4A72", "type": "Mode-S long", "rssi": 2206434179, "source_id": "f432c867-4108-4927-ba1f-1cfa71709bc4", "mlat_timestamp": 247651683777900}\n`
|