wiedehopf / readsb

ADS-B decoder swiss knife
Other
321 stars 70 forks source link

ASTERIX #34

Open k2fc opened 1 year ago

k2fc commented 1 year ago

This PR adds ASTERIX i/o support.

The following command line arguments are added: --net-ai-port --net-ao-port --net-asterix-reduce

Additionally --net-connector has the following formats added: asterix_in asterix_out

Currently, only CAT021 (ADS-B) messages are supported. The following CAT021 items work: Item Number Description Notes
10 Data Source Identification Hard Coded to output SAC=0 SIC=1. Discarded on input. Required field per Asterix spec
40 Target Report Descriptor
71 Time of Applicability for position Input only
130 Position in WGS-84 Coordinates Output and input
131 Position in WGS-84 Coordinates (High-Resolution) Input only
72 Time of Applicability for velocity Input only
150 Air Speed
151 True Airspeed
80 Target Address
73 Time of Message Reception of Position
74 Time of Message Reception of Velocity - High Precision Input Only
75 Time of Message Reception for Velocity
76 Time of Message Reception for Velocity – High Precision Input Only
140 Geometric Height
90 Quality Indicators I do not fully understand these, so it's probably not correct
210 MOPS Version I do not fully understand these, so it's probably not correct
70 Mode 3/A Code
230 Roll Angle
145 Flight Level
152 Magnetic Heading
200 Target Status I do not fully understand these, so it's probably not correct (especially Nav Modes)
155 Barometric Vertical Rate
157 Geometric Vertical Rate
160 Airborne Ground Vector
77 Time of Report Transmission
170 Target Identification (Callsign)
20 Emitter Category I do not fully understand this, so it's probably not correct
220 Met Information Ouput only. I tried to add COMM_B code to decode met information, but I have not decoded any. Unknown if this works. readsb can still continue to derive the met information on its own, but it won't be sent over ASTERIX.
8 Aircraft Operational Status I do not fully understand this. It may be correct, but I wouldn't bet money on it.
400 Receiver ID Output only. Only 8 bits are available. I simply took the last 8 bits of mm->receiverId... it should probably be a hash.

MLAT messages are not passed. I don't have access to MLAT data to work with, but MLAT data should be exchanged as CAT020.

Known issues

Most issues are caused by my lack of understanding on some of the internals.

k2fc commented 1 year ago

The ASTERIX CAT021 spec document: https://www.eurocontrol.int/sites/default/files/2021-12/asterix-adsbtr-cat021-part12-v2-6.pdf

wiedehopf commented 1 year ago

I will start looking at the overall diff of these changes once this PR doesn't change for a day or two.

Asterix seems like an overcomplicated badly documented protocol.

Also lol: NOTE: This edition is NOT backwards compatible to category 021 edition 2.1 or earlier

I'm sorry i'm not enthusiastic about merging stuff but it's usually things i don't need / find interesting and that's just a chore. I'll try though just don't expect this to happen quickly. I don't have any big changes to readsb planned so ... at least rebasing shouldn't be much necessary for you and you can just continue to work based on your fork.

I suppose it might be worth to merge the basic skeleton ... i'll see about that the next couple days.

wiedehopf commented 11 months ago

So this kinda needs a rebase. But i'll try and make a diff and just make one big patch i guess.

Is the merged version working for you?

wiedehopf commented 11 months ago

So i want this as one big commit i'm making right now. It is just a diff from the current state.a Plus some whitespace fixes (trailing space / indent).

I'll see how i can attribute you. Will try just messing with a commit ;)

wiedehopf commented 11 months ago

https://github.com/wiedehopf/readsb/tree/asterix

Ok please test this, make a new branch on your side and make a new PR using this commit i made. That should give you all the attribution properly.

I'll close this PR, feel free to just copy the text from the new PR.

wiedehopf commented 10 months ago

@k2fc i'm trying to merge this but i'd like it to show properly on github that it was your PR ... but due to rebase and stuff anyhow it's complicated. You mind getting that branch over to you? I can change the branch name if that's an issue.

wiedehopf commented 6 months ago

@k2fc This is merged, but it won't show as merged here as i wanted to flatten all the work in progress commits a bit.

Merged as: https://github.com/wiedehopf/readsb/commit/8dfb94b4e6062e3751ea31a2823d4bdddd49ea0d

I tried to get you to pull that branch so i can just merge it and it shows as PR on here but there was no response. If that's important to you, i can still make that happen.

wiedehopf commented 6 months ago

Keeping this PR open even though it's merged for some visibility of the feature :)