Commit graph

107 commits

Author SHA1 Message Date
Oliver Jowett 8b8f8d7a40 Use INVALID_ALTITUDE in a few more places. 2016-08-26 21:38:06 +01:00
Oliver Jowett a910454c02 Comm-D ELM is actually DF 24..31, not just 24.
This DF is formatted with the first two bits as 1, and the next 3 bits
are part of the message rather than part of the DF code. So effectively
it spans 8 DF values if you are looking at the full 5 bits.
2016-08-26 11:35:11 +01:00
Raphael Geissert 1269d73690 Fix another string format where %d is used but an unsigned int is passed 2016-04-05 21:05:36 +02:00
Oliver Jowett 356cda2917 Flush stdout after writing message details so it works reasonably if there's also stderr output nearby. 2016-02-05 15:41:10 +00:00
Oliver Jowett 2a07897354 Be more selective about what is flagged as TIS-B. 2016-01-24 19:09:30 +00:00
Oliver Jowett 1a2926b311 Display ES data for DF=18, CF=2 when showing messages verbosely.
Always show an address for DF=18, using the NON_ICAO flag as needed.
2016-01-22 14:36:59 +00:00
Oliver Jowett cc04f315b4 Make the HAE/Baro offset field a bit clearer.
(given that I got confused by the old name after only a couple of weeks
away from that code..)
2016-01-22 14:36:17 +00:00
Oliver Jowett d9eec668cf Track what data we got via TIS-B, report it as such. 2016-01-21 19:42:37 +00:00
Oliver Jowett 9479a5c9be If --hae is passed, report altitudes as HAE where available, with a H suffix.
This affects interactive mode and SBS output.
2016-01-01 15:15:28 +00:00
Oliver Jowett efd6b94310 Track HAE altitude separately to baro altitude where possible. 2016-01-01 13:42:30 +00:00
Oliver Jowett f6ff1c853b Show synthetic MLAT messages as such. 2015-06-29 12:42:50 +01:00
Oliver Jowett 803760ca80 Treat an all-zeros message as bad. 2015-06-29 00:50:19 +01:00
Oliver Jowett 75851778c0 Fix up filter population so it's not completely insane.
The logic for DF11 was completely broken and inverted. How did this ever work??

Actually, the broken version kinda works because the only types of message that
can yield an address that's not already in the ICAO filter are DF11/17/18.
So DF=17; DF=18; and DF=11 with IID=0 would pass the broken logic and populate the
filter. All other DFs would pass the broken test, too, but they can only ever
re-add entries that were already there.
2015-06-29 00:46:34 +01:00
Oliver Jowett 934dfee6a4 Change the mlat timestamp to something that doesn't need escaping. 2015-06-29 00:31:42 +01:00
Oliver Jowett 12a7d45e75 Mlat synthetic message detection.
Notice synthetic mlat messages by looking for messages with a magic
timestamp value. If they arrive, tag the derived data as mlat-derived.

Don't include mlat-derived output in FATSV output to avoid loops.
2015-06-28 20:04:09 +01:00
Oliver Jowett f58ff14d7c Fix queueing/resending very old Mode A/C messages.
Fixes #47.
2015-06-07 23:00:24 +01:00
Oliver Jowett 0bd897cad1 Fix --mlat --raw stdout formatting on big-endian systems. 2015-04-19 00:57:24 +01:00
Oliver Jowett 15ea5ba3da Rearrangements to the receive thread.
Magnitude conversion now happens immediately when sample data is
received, so there is no risk of newly received data clobbering old
data under CPU overload.
2015-04-09 18:51:31 +01:00
Oliver Jowett e1d262d992 Add --show-only for extracting messages from a single plane. 2015-02-22 23:01:54 +00:00
Oliver Jowett 8f3be2cd79 Decode aircraft category, export in aircraft.json.
Closes #2.
2015-02-22 12:15:26 +00:00
Oliver Jowett 474fe45256 Don't mark undecodable altitudes as ALTITUDE_VALID when decoding. 2015-02-09 22:53:18 +00:00
Oliver Jowett 54677f3ae0 Don't try to correct >1 error in DF11.
We already do this check when scoring a message for the demodulator,
but there are other paths that can feed us a message so also do the
check in the main decode path.
2015-02-09 22:51:34 +00:00
Oliver Jowett 9fd0c822f6 Extract NUCp from message type; needed for #16. 2015-02-09 14:14:12 +00:00
Oliver Jowett e7e7f9e7c2 Only display altitude when dumping position messages if it is valid. 2015-02-09 14:11:04 +00:00
Oliver Jowett f1201a0069 Third time lucky? 2015-02-08 18:17:33 +00:00
Oliver Jowett b31709a278 Whoops, remove stray debugging that was left in. 2015-02-08 18:16:49 +00:00
Oliver Jowett 4ecd6958a1 If we squelch the first message from an aircraft, emit it when we see a second message.
This is possible now that the SBS output doesn't rely on the global block timestamp;
the output will look like this:

MSG,8,111,11111,4AC954,111111,2015/02/08,17:57:53.917,2015/02/08,17:57:53.936,,,,,,,,,,,,0
MSG,7,111,11111,392AEB,111111,2015/02/08,17:57:53.744,2015/02/08,17:57:53.936,,15375,,,,,,,,,,0
MSG,8,111,11111,392AEB,111111,2015/02/08,17:57:53.917,2015/02/08,17:57:53.936,,,,,,,,,,,,0
MSG,6,111,11111,800387,111111,2015/02/08,17:57:53.919,2015/02/08,17:57:53.936,,,,,,,,4745,0,0,0,0

where the "receive timestamp" (first time column) goes backwards to reflect the original reception
time of the delayed message, but the "forwarded timestamp" (second time column) reflects the actual
forwarding time.
2015-02-08 18:00:18 +00:00
Oliver Jowett 899c51ce85 Only emit network messages once we have seen two of them
(except in --net-verbatim mode, where we emit them all)

Move aircraft tracking into track.[ch].

Clean up references to "interactive mode" when tracking
aircraft - we always track aircraft, even in non-interactive
mode.
2015-02-08 14:27:03 +00:00
Oliver Jowett 9381a20198 Support more DF18 message formats. Test for the IMF bit where appropriate.
Fixes #4.
2015-01-29 23:08:33 +00:00
Oliver Jowett 26feb1d078 Add some testing code that looks for ambiguous syndromes that
could confuse the partial correction used in DF11.

That code shows that yes, there are ambiguous syndromes in the
2-bit correction case only, so disable corrections of more than
1 bit in DF11.
2015-01-23 21:59:31 +00:00
Oliver Jowett 5020d75b9e Move setting of CF earlier so we can use its value while decoding AA.
(Needed to notice non-ICAO addresses in TIS-B)
2015-01-22 22:19:38 +00:00
Oliver Jowett 008ae926e7 Add --net-verbatim, which forwards the original uncorrected message to net clients,
not the corrected version. Then the client can make its own policy decisions about
whether to accept and correct the damaged messages.
2015-01-22 19:56:38 +00:00
Oliver Jowett a59077a370 Stats overhaul. 2015-01-22 19:49:19 +00:00
Oliver Jowett ada188a1c8 Changed my mind, put the non-ICAO flag bit in the address itself
since we have 8 bits spare, so there's no chance of confusing it
with an ICAO address, and we can safely use the filter table to match
future messages without also matching equivalent ICAO addresses.
2015-01-22 12:30:12 +00:00
Oliver Jowett 9a91507583 Flag non-ICAO addresses, display them differently in interactive mode. 2015-01-22 11:14:22 +00:00
Oliver Jowett 34ae2c7349 Make sure to clear address. 2015-01-22 11:13:54 +00:00
Oliver Jowett 04eff1778f Use the right field for CF in DF 18 2015-01-22 10:59:11 +00:00
Oliver Jowett 19082d92ea Measure signal power / noise power (at least in 2.4MHz mode).
Switch signalLevel back to a power measurement, don't put SNR in there.
But make it a 0.0 - 1.0 double so we're not scaling everywhere.

Adjust for the amplitude offset when calculating power.

Adapt everything else to the new scheme.
2015-01-22 01:01:39 +00:00
Oliver Jowett 5beecb9f4f Disable overlay control as it seems to cause more problems than it solves
at the moment (aircraft randomly appearing to be on the ground due to
CRC errors, etc)
2015-01-22 00:59:44 +00:00
Oliver Jowett ef098a2461 Import new 2.4MHz demodulator from experimental branch. 2015-01-21 13:32:17 +00:00
Oliver Jowett 0493248425 Minor cleanups / comments. 2015-01-21 12:55:46 +00:00
Oliver Jowett a33e4388c9 Add scoreModesMessage() 2015-01-21 12:55:24 +00:00
Oliver Jowett 8ce92f126a More logging for Comm-B messages. 2015-01-21 01:21:32 +00:00
Oliver Jowett 5e522fe8db Decoder cleanups from experimental branch. 2015-01-21 00:23:48 +00:00
Oliver Jowett 0433ed3f5d icao_filter.[ch] from the experimental branch. 2015-01-20 23:53:26 +00:00
Oliver Jowett 270a22e06a CRC reimplementation to be byte-at-a-time table-driven.
Also be smarter about error correction, avoiding ambiguous cases
when --aggressive is specified.
2015-01-20 23:04:05 +00:00
Oliver Jowett ed4d481772 Import CPR changes from experimental branch. 2015-01-20 18:41:44 +00:00
Oliver Jowett b9b76da02d Stats rearrangement, based on experimental branch changes. 2015-01-20 17:16:35 +00:00
Oliver Jowett e02a2cdd44 GPL. 2015-01-20 16:49:01 +00:00
Oliver Jowett f753c2d9fe Separate 2.4MHz demodulator into its own file. 2015-01-19 23:50:25 +00:00