Skip to content

Commit c08f043

Browse files
committed
Improve DF16 decoding
1 parent cd1b23a commit c08f043

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

src/main/java/aero/t2s/modes/constants/AcasReplyInformation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public enum AcasReplyInformation {
1212
/**
1313
* 2 - reserved for ACAS
1414
*/
15-
RESERVED2,
15+
ACAS_RA_INHIBIT,
1616
/**
1717
* 3 - reserved for ACAS
1818
*/
19-
RESERVED3,
19+
ACAS_RA_VERTICAL_ONLY,
2020
/**
2121
* 4 - reserved for ACAS
2222
*/
@@ -32,7 +32,7 @@ public enum AcasReplyInformation {
3232
/**
3333
* 7 - reserved for ACAS
3434
*/
35-
RESERVED7,
35+
ACAS_RA_FULL,
3636
/**
3737
* 8 - no maximum airspeed data available
3838
*/

src/test/java/aero/t2s/modes/decoder/df/DF0Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void it_decodes_sensitivity_level()
4343
void it_decodes_reply_information()
4444
{
4545
df0 = new DF0(BinaryHelper.stringToByteArray("02E194979F2C4B")).decode();
46-
assertEquals(AcasReplyInformation.RESERVED3, df0.getReplyInformation());
46+
assertEquals(AcasReplyInformation.ACAS_RA_VERTICAL_ONLY, df0.getReplyInformation());
4747
}
4848

4949
@Test

src/test/java/aero/t2s/modes/decoder/df/DfRealMessageTest.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package aero.t2s.modes.decoder.df;
22

33
import aero.t2s.modes.BinaryHelper;
4-
import aero.t2s.modes.constants.SelectedAltitudeSource;
4+
import aero.t2s.modes.constants.*;
55
import aero.t2s.modes.database.ModeSDatabase;
66
import aero.t2s.modes.decoder.Decoder;
77
import aero.t2s.modes.decoder.UnknownDownlinkFormatException;
@@ -339,6 +339,32 @@ public void test_df20_bds50_48418A() throws UnknownDownlinkFormatException {
339339
assertEquals(354, bds.getTrueTrack(), 0.1);
340340
}
341341

342+
@Test
343+
public void test_df16_bds50_48418A() throws UnknownDownlinkFormatException {
344+
DownlinkFormat df = testMessage("80C18819584195384EF8505941FD");
345+
346+
assertInstanceOf(DF16.class, df);
347+
DF16 df16 = (DF16) df;
348+
assertEquals("02A198", df.getIcao()); // Military / corrupt transponder
349+
assertEquals(12025, df16.getAltitude().getAltitude());
350+
351+
assertEquals(VerticalStatus.AIRBORNE, df16.getVerticalStatus());
352+
assertEquals(AcasSensitivity.LEVEL6, df16.getSensitivity());
353+
assertEquals(AcasReplyInformation.ACAS_RA_VERTICAL_ONLY, df16.getReplyInformation());
354+
assertFalse(df16.getResolutionAdvisory().isActive());
355+
assertFalse(df16.getResolutionAdvisory().isRequiresCorrectionUpwards());
356+
assertFalse(df16.getResolutionAdvisory().isRequiresCorrectionDownwards());
357+
assertFalse(df16.getResolutionAdvisory().isRequiresPositiveClimb());
358+
assertFalse(df16.getResolutionAdvisory().isRequiresPositiveDescend());
359+
assertFalse(df16.getResolutionAdvisory().isRequiresCrossing());
360+
assertFalse(df16.getResolutionAdvisory().isSenseReversal());
361+
362+
assertFalse(df16.isMultipleThreats());
363+
assertFalse(df16.isRANotPassAbove());
364+
assertFalse(df16.isRANotPassBelow());
365+
assertFalse(df16.isRANotTurnLeft());
366+
assertFalse(df16.isRANotTurnRight());
367+
}
342368

343369
private DownlinkFormat testMessage(String message) throws UnknownDownlinkFormatException {
344370
Decoder decoder = new Decoder(new HashMap<>(), 50, 2, ModeSDatabase.createDatabase());

0 commit comments

Comments
 (0)