Issue
The current implementation says
// heading available in ADS-B version 1+, indicates true/magnetic north for version 0
and
/**
* For ADS-B version 1 and 2 this must be checked before retrieving heading information.
*
* @return Depending on the ADS-B version, different interpretations:
* <ul>
* <li><strong>Version 0</strong> the flag indicates whether heading is relative to magnetic north (true) or
* true north (false)</li>
* <li><strong>Version 1+</strong> the flag indicates whether heading information is available or not</li>
* </ul>
*/
which is wrong.
First, from DO-260 it is clearly states that the bit also means availability of such data.
Same is visible from DO-260B, Figure N-5.
Where it really gets tricky is DO-260B, N.2.3.11 and I guess this is where the confusion comes from.
It defines some kind of double role for the bit: when it is not set
- it means that information is not available
- that the ADS-B report should set its bits equivalent to "indicating true north"
Now the more important thing here are the notes below that table, especially the last one. It clearly says that V0 never conveys true north heading.
So all this table says is "if there is no data available, set the reference to true north anyway", which only defines THEIR ADS-B report - for which we don't care here.
Anyway, the implementation is actually only wrong on its comments - the flag is always interpreted when accessing getHeading().
Bigger picture
- no matter the ADS-B version, the bit always denotes whether magnetic heading data is available
- if it is available
- and this is a V0 target, we directly know that it is referenced to magnetic north
- and it is a V1+ target, we need to know the HRD bit from the Aircraft Operational Status to determine the reference
Issue
The current implementation says
and
which is wrong.
First, from DO-260 it is clearly states that the bit also means availability of such data.
Same is visible from DO-260B, Figure N-5.
Where it really gets tricky is DO-260B, N.2.3.11 and I guess this is where the confusion comes from.
It defines some kind of double role for the bit: when it is not set
Now the more important thing here are the notes below that table, especially the last one. It clearly says that V0 never conveys true north heading.
So all this table says is "if there is no data available, set the reference to true north anyway", which only defines THEIR ADS-B report - for which we don't care here.
Anyway, the implementation is actually only wrong on its comments - the flag is always interpreted when accessing
getHeading().Bigger picture