Skip to content

Commit

Permalink
BDS60 is not valid if status magnetic heading is false and value is n…
Browse files Browse the repository at this point in the history
…ot 0
  • Loading branch information
Douglasdc3 committed Nov 15, 2020
1 parent 7c7c4f0 commit 68d06c9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/aero/t2s/modes/decoder/df/bds/Bds60.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ public Bds60(short[] data) {
if (magneticHeading < 0) {
magneticHeading += 360d;
}
if (statusMagneticHeading && (magneticHeading <= 0 || magneticHeading > 360.0)) {
invalidate();
return;
if (statusMagneticHeading) {
if (magneticHeading <= 0 || magneticHeading > 360.0) {
invalidate();
return;
}
} else {
if (magneticHeading != 0) {
invalidate();
return;
}
}

ias = ((data[5] & 0x7) << 7) | data[6] >>> 1;
Expand Down

0 comments on commit 68d06c9

Please sign in to comment.