Skip to content

Commit

Permalink
Merge pull request #33 from openskynetwork/ground-status
Browse files Browse the repository at this point in the history
Better decoding and documentation for airborne/ground status
  • Loading branch information
fixje authored Aug 21, 2020
2 parents 3741a85 + d88699c commit 0830b44
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 8 deletions.
19 changes: 19 additions & 0 deletions src/main/java/org/opensky/libadsb/msgs/AllCallReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ public byte getCapabilities() {
return capabilities;
}

/**
* @return whether capabilities indicate that aircraft is on the ground.
* Note that returning false does not indicate that the aircraft is airborne as status might be unknown!
* See also {@link #isAirborne()}.
*/
public boolean isOnGround() {
return capabilities == 4;
}

/**
* @return whether capabilities indicate that aircraft is airborne.
* Note that returning false does not indicate that the aircraft is on ground as status might be unknown!
* See also {@link #isOnGround()}.
*/
public boolean isAirborne() {
return capabilities == 5;
}


/**
* Some receivers already subtract the crc checksum
* from the parity field right after reception.
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/opensky/libadsb/msgs/AltitudeReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,23 @@ public boolean hasSPI() {
}

/**
* @return whether flight status indicates that aircraft is
* airborne or on the ground; For flight status >= 4, this flag is unknown
* @return whether flight status indicates that aircraft is on the ground.
* For flight status >= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is airborne! See also {@link #isAirborne()}.
*/
public boolean isOnGround() {
return flight_status==1 || flight_status==3;
}

/**
* @return whether flight status indicates that aircraft is airborne.
* For flight status >= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is on ground! See also {@link #isOnGround()} .
*/
public boolean isAirborne() {
return flight_status == 0 || flight_status == 2;
}

/**
* indicator for downlink requests
* @return the 5 bits downlink request. The coding is:<br>
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/opensky/libadsb/msgs/CommBAltitudeReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,23 @@ public boolean hasSPI() {
}

/**
* @return whether flight status indicates that aircraft is
* airborne or on the ground; For flight status &gt;= 4, this flag is unknown
* @return whether flight status indicates that aircraft is on the ground.
* For flight status &gt;= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is airborne! See also {@link #isAirborne()}.
*/
public boolean isOnGround() {
return flight_status==1 || flight_status==3;
}

/**
* @return whether flight status indicates that aircraft is airborne.
* For flight status &gt;= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is on ground! See also {@link #isOnGround()} .
*/
public boolean isAirborne() {
return flight_status == 0 || flight_status == 2;
}

/**
* indicator for downlink requests
* @return the 5 bits downlink request. The coding is:<br>
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/opensky/libadsb/msgs/CommBIdentifyReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,23 @@ public boolean hasSPI() {
}

/**
* @return whether flight status indicates that aircraft is
* airborne or on the ground; For flight status &gt;= 4, this flag is unknown
* @return whether flight status indicates that aircraft is on the ground.
* For flight status &gt;= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is airborne! See also {@link #isAirborne()}.
*/
public boolean isOnGround() {
return flight_status==1 || flight_status==3;
}

/**
* @return whether flight status indicates that aircraft is airborne.
* For flight status &gt;= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is on ground! See also {@link #isOnGround()} .
*/
public boolean isAirborne() {
return flight_status == 0 || flight_status == 2;
}

/**
* indicator for downlink requests
* @return the 5 bits downlink request. The coding is:<br>
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/opensky/libadsb/msgs/IdentifyReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,23 @@ public boolean hasSPI() {
}

/**
* @return whether flight status indicates that aircraft is
* airborne or on the ground; For flight status &gt;= 4, this flag is unknown
* @return whether flight status indicates that aircraft is on the ground.
* For flight status &gt;= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is airborne! See also {@link #isAirborne()}.
*/
public boolean isOnGround() {
return flight_status==1 || flight_status==3;
}

/**
* @return whether flight status indicates that aircraft is airborne.
* For flight status &gt;= 4, this flag is unknown. Thus, a return value of false
* does not indicate that the aircraft is on ground! See also {@link #isOnGround()} .
*/
public boolean isAirborne() {
return flight_status == 0 || flight_status == 2;
}

/**
* indicator for downlink requests
* @return the 5 bits downlink request. The coding is:<br>
Expand Down

0 comments on commit 0830b44

Please sign in to comment.