Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NACp in v1 and v2 airborne positions #11

Open
fixje opened this issue Jan 30, 2023 · 0 comments
Open

NACp in v1 and v2 airborne positions #11

fixje opened this issue Jan 30, 2023 · 0 comments

Comments

@fixje
Copy link

fixje commented Jan 30, 2023

The method public byte getNACp() is available in AirbornePositionV1Msg and AirbornePositionV2Msg through inheritance. Semantically, this is not correct as stated in the Javadoc:

In ADS-B version 1+ this information is contained in the operational status message. For version 0 it is derived from the format type code.

Maybe we should make this more explicit?

Alternatives that come to my mind, both overriding the method in AirbornePositionV1Msg and AirbornePositionV1Msg:

  1. Throw an Exception
  2. Introduce a field to the V1 and V2 airborne position messages. The overridden getNACp method returns the field value. The field value is set by the state-ful decoder upon reception of an AirborneOperationalStatusMsg
  3. Major refactoring: remove inheritance relationship and replace with appropriate interfaces

In solution (2), the method will only be used when the AirbornePositionMsg is created by an instance of Decoder. Note that we have similar behavior already with getNIC, where supplements need to be set.

@fixje fixje changed the title NACp in v2 airborne positions NACp in v1 and v2 airborne positions Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant