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

Implementing BDS decoding using fixed length definitions #41

Closed
ifsnop opened this issue May 3, 2016 · 6 comments
Closed

Implementing BDS decoding using fixed length definitions #41

ifsnop opened this issue May 3, 2016 · 6 comments

Comments

@ifsnop
Copy link
Contributor

ifsnop commented May 3, 2016

Hi Damir,

Do you think is it possible to define the bds contents inside I48/250 (ie. bds40, bds50, bds60) using fixed length definitions? Once defined, is it possible to reference them inside the cat48 xml?

I could provide examples for all of them, if needed, and also write the new xml files, if it is feasible.

What do you think?

@dsalantic
Copy link
Contributor

Hi Diego,

BDS decoding would be very useful feature for me as well, but unfortunately it is not so easy to implement. The problem is that the BDS format does not follow Asterix formats, and there are too many conditional formatting (e.g. format of a field depends on the value of previous field).
Because of that it is not possible to define it using current XML schema (except maybe for some of the registers which are simple).
My idea was to adapt the Asterix decoder in code to enable BDS decoding, and probably I will do it some time when I find time.
Let me know if you have some better idea how to implement that.
BR,
Damir

@ifsnop
Copy link
Contributor Author

ifsnop commented May 4, 2016

BDS format is fixed, at least for the most common ones (BDS0,5 BDS0,6 BDS1,0 BDS1,7 BDS4,0 BDS5,0 and BDS6,0). On the other hand, BDS3,0 has some conditionals that are as you said. Some time ago I did my own asterix decoder, and used a similar trick (to use a dataitem definition to describe BDSs). The only addition is to write to code needed to reference the new definitions from the values in I048/250/bds1 & I048/250/bds2.

These are the xml definitions I use with my own version, they can be useful as an example. (This is one of the few things remaining that stop me from using your parser for everyday tasks).

<dataitem name="bds00" type="_multibit" size="7" rule="_optional" description="air initiated comm-b">
      <field name="codigobds00a" size="8" description="bits 1-8" />
      <field name="codigobds00b" size="8" description="bits 9-16" />
      <field name="codigobds00c" size="8" description="bits 17-24" />
      <field name="codigobds00d" size="8" description="bits 25-32" />
      <field name="codigobds00e" size="8" description="bits 33-40" />
      <field name="codigobds00f" size="8" description="bits 41-48" />
      <field name="codigobds00g" size="8" description="bits 49-56" />
    </dataitem>

    <dataitem name="bds05" type="_multibit" size="7" rule="_optional" description="airborne position">
      <field name="format_type_code" size="5" />
      <field name="surveillance_status" size="2" />
      <field name="nic" />
      <field name="altitude" size="12" representation="_double" />
      <field name="time" />
      <field name="cpr_format" />
      <field name="latitude" size="17" representation="_double" />
      <field name="longitue" size="17" representation="_double" />
    </dataitem>

    <dataitem name="bds06" type="_multibit" size="7" rule="_optional" description="surface position">
      <field name="format_type_code" size="5" />
      <field name="movement" size="7" />
      <field name="status" />
      <field name="heading" size="7" representation="_double" lsb="360.0/128.0" />
      <field name="time" />
      <field name="cpr_format" />
      <field name="latitude" size="17" representation="_double" />
      <field name="longitue" size="17" representation="_double" />
    </dataitem>

    <dataitem name="bds10" type="_multibit" size="7" rule="_optional" description="informe de capacidad de enlace de datos">
      <field name="codigobds10" size="8" description="bits 1-8" />
      <field name="fx" description="bit 9" />
      <field name="reservado" size="6" description="bit 10-15" />
      <field name="reservado_acas" description="bit 16" />
      <field name="version_number" size="7" description="bits 17-23"/>
      <field name="enhanced_protocol_descriptor" description="bit 24" />
      <field name="specific_service_capacity" description="bit 25" />
      <field name="capacidad_caudal_medio_ELM" size="3" description="bits 26-28" />
      <field name="ELM_downlink" size="4" description="bit 29-32" />
      <field name="identity_aircraft_capacity" description="bit 33" />
      <field name="subcampo_capacidad_signal_espontaneas" description="bit 34" />
      <field name="codigo_identificador_vigilancia" description="bit 35" />
      <field name="common_gicb_capacity_report" description="bit 36" />
      <field name="acas_reserved" size="4" description="bits 37-40" />
      <field name="estado_apoyo_subdir_DTE0_15" size="16" description="bits 41-56" />
    </dataitem>

    <dataitem name="bds17" type="_multibit" size="7" rule="_optional" description="informe de capacidad GICB de uso comun">
      <field name="05" />
      <field name="06" />
      <field name="07" />
      <field name="08" />
      <field name="09" />
      <field name="0A" />
      <field name="20" />
      <field name="21" description="bit 8" />
      <field name="40" />
      <field name="41" />
      <field name="42" />
      <field name="43" />
      <field name="44" />
      <field name="45" />
      <field name="48" />
      <field name="50" description="bit 16" />
      <field name="51" />
      <field name="52" />
      <field name="53" />
      <field name="54" />
      <field name="55" />
      <field name="56" />
      <field name="5F" />
      <field name="60" description="bit 24" />
      <field name="reserved1" />
      <field name="reserved2" />
      <field name="E1" />
      <field name="E2" />
      <field name="F1" size="28" representation="_hexadecimal" description="bits 29-56" />
    </dataitem>
    <dataitem name="bds40" type="_multibit" size="7" rule="_optional" description="selected vertical intent">
      <field name="mcp_fcu_selected_altitude_status" description="bit 1"/>
      <field name="mcp_fcu_selected_altitude" size="12" lsb="16.0" description="bits 2-13"/>
      <field name="alt_selec_fms_status" description="bit 14"/>
      <field name="alt_selec_fms" size="12" lsb="16.0" description="bits 15-26"/>
      <field name="barometric_pressure_setting_status" description="bit 27" />
      <field name="barometric_pressure_setting" size="12" lsb="0.1" description="bits 28-39" representation="_udouble" />
      <field type="_spare" size="8" />
      <field name="mcp_fcu_mode_status" />
      <field name="vnav_mode" />
      <field name="maintenance_mode_alt" />
      <field name="modo_aproximacion" />
      <field type="_spare" size="2" />
      <field name="target_altitude_source_status" />
      <field name="target_altitude_source" size="2" />
    </dataitem>
    <dataitem name="bds50" type="_multibit" size="7" rule="_optional" description="track and turn report">
      <field name="roll_angle_status" description="bit 1" />
      <field name="roll_angle" size="10" lsb="45.0/256.0" description="bits 2-11" representation="_double" />
      <field name="true_track_angle_status" description="bit 12" />
      <field name="true_track_angle" size="11" lsb="90.0/512.0" description="bits 13-23" representation="_double" />
      <field name="ground_speed_status" description="bit 24" />
      <field name="ground_speed" lsb="1024.0/512.0" size="10" description="bit 25-34" />
      <field name="track_angle_rate_status" description="bit 35" />
      <field name="track_angle_rate" size="10" lsb="8.0/256.0" description="bits 36-45" representation="_double" />
      <field name="true_airspeed_status" description="bit 46" />
      <field name="true_airspeed" lsb="2" size="10" description="bit 47-56" />
    </dataitem>
    <dataitem name="bds60" type="_multibit" size="7" rule="_optional" description="heading and speed report">
      <field name="magnetic_heading_status" description="bit 1" />
      <field name="magnetic_heading" size="11" lsb="90.0/512.0" description="bits 2-12" representation="_double" />
      <field name="indicated_airspeed_status" description="bit 13" />
      <field name="indicated_airspeed" size="10" description="bit 14-23" />
      <field name="mach_status" description="bit 24" />
      <field name="mach" lsb="2.048/512.0" size="10" description="bit 25-34" representation="_double" />
      <field name="barometric_altitude_rate_status" description="bit 35" />
      <field name="barometric_altitude_rate" size="10" lsb="8192.0/256.0" description="bits 36-45" representation="_double" />
      <field name="inertial_vertical_velocity_status" description="bit 46" />
      <field name="inertial_vertical_velocity" lsb="8192.0/256.0" size="10" description="bit 47-56" representation="_double" />
    </dataitem>

@dsalantic
Copy link
Contributor

Thanks for that. I will try to implement it in code.

dsalantic added a commit that referenced this issue May 6, 2016
#41 Implementing BDS decoding using fixed length definitions
@dsalantic
Copy link
Contributor

There is a first version of BDS decoding using same format for BDS definition as for Asterix messages.
Please take "BDS_decoding" branch and try it.
Look in config/asterix_bds.xml, there I defined BDS 4,0 and 5,0.
Make sure that you add asterix_bds.xml to the beginning of asterix.ini.
Also you need to modify the Asterix category that contains BDS (look in asterix_cat048_1_14.xml).
For more complicated BDS (like 3,0), other modifications in code will be needed, because current format does not allow conditional formatting. I hope I'll be able to implement it soon.

@ifsnop
Copy link
Contributor Author

ifsnop commented May 7, 2016

Looks very good!

On Fri, May 6, 2016 at 2:28 PM, Damir Salantic notifications@github.com
wrote:

There is a first version of BDS decoding using same format for BDS
definition as for Asterix messages.
Please take "BDS_decoding" branch and try it.
Look in config/asterix_bds.xml, there I defined BDS 4,0 and 5,0.
Make sure that you add asterix_bds.xml to the beginning of asterix.ini.
Also you need to modify the Asterix category that contains BDS (look in
asterix_cat048_1_14.xml).
For more complicated BDS (like 3,0), other modifications in code will be
needed, because current format does not allow conditional formatting. I
hope I'll be able to implement it soon.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#41 (comment)

-- Use of a keyboard or mouse may be linked to serious injuries or
disorders.
diego dot torres at gmail dot com - Madrid / Spain

dsalantic added a commit that referenced this issue Jul 6, 2016
#41 Implementing BDS decoding using fixed length definitions
@dsalantic
Copy link
Contributor

Implemented BDS decoding (for now only registers 40,50,60). Merged to master.

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

2 participants