Skip to content

Commit

Permalink
[messages][modules] add AIR_DATA message
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Oct 22, 2014
1 parent 1dda6d3 commit 36b9e05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion conf/messages.xml
Expand Up @@ -1944,7 +1944,16 @@
<field name="diff" type="float"/>
</message>

<!--222 is free -->
<message name="AIR_DATA" id="222">
<field name="pressure" type="float" unit="Pa"/>
<field name="diff_p" type="float" unit="Pa"/>
<field name="temp" type="float" unit="deg celcius"/>
<field name="qnh" type="float" unit="hPa"/>
<field name="amsl_baro" type="float" unit="m"/>
<field name="airspeed" type="float" unit="m/s"/>
<field name="tas_factor" type="float"/>
</message>

<!--223 is free -->
<!--224 is free -->

Expand Down
10 changes: 10 additions & 0 deletions sw/airborne/modules/air_data/air_data.c
Expand Up @@ -147,6 +147,15 @@ static void send_baro_raw(void)
DOWNLINK_SEND_BARO_RAW(DefaultChannel, DefaultDevice,
&air_data.pressure, &air_data.differential);
}

static void send_air_data(void)
{
DOWNLINK_SEND_AIR_DATA(DefaultChannel, DefaultDevice,
&air_data.pressure, &air_data.differential,
&air_data.temperature, &air_data.qnh,
&air_data.amsl_baro, &air_data.airspeed,
&air_data.tas_factor);
}
#endif

/** AirData initialization. Called at startup.
Expand All @@ -171,6 +180,7 @@ void air_data_init(void)

#if PERIODIC_TELEMETRY
register_periodic_telemetry(DefaultPeriodic, "BARO_RAW", send_baro_raw);
register_periodic_telemetry(DefaultPeriodic, "AIR_DATA", send_air_data);
#endif
}

Expand Down

0 comments on commit 36b9e05

Please sign in to comment.