Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
downlink.h File Reference

Common code for AP and FBW telemetry. More...

#include <inttypes.h>
#include "generated/modules.h"
#include "messages.h"
#include "generated/airframe.h"
#include "subsystems/datalink/udp.h"
#include "subsystems/datalink/pprz_transport.h"
#include "subsystems/datalink/pprzlog_transport.h"
#include "subsystems/datalink/xbee.h"
#include "subsystems/datalink/w5100.h"
#include "mcu_periph/uart.h"
+ Include dependency graph for downlink.h:

Go to the source code of this file.

Macros

#define DefaultChannel   DOWNLINK_TRANSPORT
 SITL. More...
 
#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE
 
#define DefaultDevice   DOWNLINK_DEVICE
 
#define __Transport(dev, _x)   dev##_x
 
#define _Transport(dev, _x)   __Transport(dev, _x)
 
#define Transport(_chan, _fun)   _Transport(_chan, _fun)
 
#define DownlinkIDsSize(_trans, _dev, _x)   (_x+2)
 Set of macros for generated code (messages.h) from messages.xml. More...
 
#define DownlinkSizeOf(_trans, _dev, _x)   Transport(_trans, SizeOf(_dev, DownlinkIDsSize(_trans, _dev, _x)))
 
#define DownlinkCheckFreeSpace(_trans, _dev, _x)   Transport(_trans, CheckFreeSpace(_dev, (uint8_t)(_x)))
 
#define DownlinkPutUint8(_trans, _dev, _x)   Transport(_trans, PutUint8(_dev, _x))
 
#define DownlinkPutInt8ByAddr(_trans, _dev, _x)   Transport(_trans, PutInt8ByAddr(_dev, _x))
 
#define DownlinkPutUint8ByAddr(_trans, _dev, _x)   Transport(_trans, PutUint8ByAddr(_dev, _x))
 
#define DownlinkPutInt16ByAddr(_trans, _dev, _x)   Transport(_trans, PutInt16ByAddr(_dev, _x))
 
#define DownlinkPutUint16ByAddr(_trans, _dev, _x)   Transport(_trans, PutUint16ByAddr(_dev, _x))
 
#define DownlinkPutInt32ByAddr(_trans, _dev, _x)   Transport(_trans, PutInt32ByAddr(_dev, _x))
 
#define DownlinkPutUint32ByAddr(_trans, _dev, _x)   Transport(_trans, PutUint32ByAddr(_dev, _x))
 
#define DownlinkPutFloatByAddr(_trans, _dev, _x)   Transport(_trans, PutFloatByAddr(_dev, _x))
 
#define DownlinkPutDoubleByAddr(_trans, _dev, _x)   Transport(_trans, PutDoubleByAddr(_dev, _x))
 
#define DownlinkPutUint64ByAddr(_trans, _dev, _x)   Transport(_trans, PutUint64ByAddr(_dev, _x))
 
#define DownlinkPutInt64ByAddr(_trans, _dev, _x)   Transport(_trans, PutInt64ByAddr(_dev, _x))
 
#define DownlinkPutCharByAddr(_trans, _dev, _x)   Transport(_trans, PutCharByAddr(_dev, _x))
 
#define DownlinkPutFloatArray(_trans, _dev, _n, _x)   Transport(_trans, PutFloatArray(_dev, _n, _x))
 
#define DownlinkPutDoubleArray(_trans, _dev, _n, _x)   Transport(_trans, PutDoubleArray(_dev, _n, _x))
 
#define DownlinkPutInt16Array(_trans, _dev, _n, _x)   Transport(_trans, PutInt16Array(_dev, _n, _x))
 
#define DownlinkPutUint16Array(_trans, _dev, _n, _x)   Transport(_trans, PutUint16Array(_dev, _n, _x))
 
#define DownlinkPutInt32Array(_trans, _dev, _n, _x)   Transport(_trans, PutInt32Array(_dev, _n, _x))
 
#define DownlinkPutUint32Array(_trans, _dev, _n, _x)   Transport(_trans, PutUint32Array(_dev, _n, _x))
 
#define DownlinkPutInt64Array(_trans, _dev, _n, _x)   Transport(_trans, PutInt64Array(_dev, _n, _x))
 
#define DownlinkPutUint64Array(_trans, _dev, _n, _x)   Transport(_trans, PutUint64Array(_dev, _n, _x))
 
#define DownlinkPutInt8Array(_trans, _dev, _n, _x)   Transport(_trans, PutInt8Array(_dev, _n, _x))
 
#define DownlinkPutUint8Array(_trans, _dev, _n, _x)   Transport(_trans, PutUint8Array(_dev, _n, _x))
 
#define DownlinkPutCharArray(_trans, _dev, _n, _x)   Transport(_trans, PutCharArray(_dev, _n, _x))
 
#define DownlinkPutFloatFixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutFloatFixedArray(_dev, _n, _x))
 
#define DownlinkPutDoubleFixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutDoubleFixedArray(_dev, _n, _x))
 
#define DownlinkPutInt16FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutInt16FixedArray(_dev, _n, _x))
 
#define DownlinkPutUint16FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutUint16FixedArray(_dev, _n, _x))
 
#define DownlinkPutInt32FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutInt32FixedArray(_dev, _n, _x))
 
#define DownlinkPutUint32FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutUint32FixedArray(_dev, _n, _x))
 
#define DownlinkPutInt64FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutInt64FixedArray(_dev, _n, _x))
 
#define DownlinkPutUint64FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutUint64FixedArray(_dev, _n, _x))
 
#define DownlinkPutInt8FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutInt8FixedArray(_dev, _n, _x))
 
#define DownlinkPutUint8FixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutUint8FixedArray(_dev, _n, _x))
 
#define DownlinkPutCharFixedArray(_trans, _dev, _n, _x)   Transport(_trans, PutCharFixedArray(_dev, _n, _x))
 
#define DownlinkOverrun(_trans, _dev)   downlink_nb_ovrn++;
 
#define DownlinkCountBytes(_trans, _dev, _n)   downlink_nb_bytes += _n;
 
#define DownlinkStartMessage(_trans, _dev, _name, msg_id, payload_len)
 
#define DownlinkEndMessage(_trans, _dev)   Transport(_trans, Trailer(_dev))
 

Variables

uint8_t downlink_nb_ovrn
 Counter of messages not sent because of unavailibity of the output buffer. More...
 
uint16_t downlink_nb_bytes
 
uint16_t downlink_nb_msgs
 

Detailed Description

Common code for AP and FBW telemetry.

Definition in file downlink.h.

Macro Definition Documentation

#define __Transport (   dev,
  _x 
)    dev##_x

Definition at line 103 of file downlink.h.

#define _Transport (   dev,
  _x 
)    __Transport(dev, _x)

Definition at line 104 of file downlink.h.

#define DefaultChannel   DOWNLINK_TRANSPORT

SITL.

!SITL

Definition at line 81 of file downlink.h.

Referenced by adc_generic_periodic(), add_slot(), ahrs_propagate(), ahrs_update_mag(), airspeed_amsys_downlink(), airspeed_ets_read_event(), airspeed_otf_parse(), alt_filter_periodic(), alt_kalman(), aoa_adc_update(), ArduIMU_event(), aspirin2_subsystem_downlink_raw(), atmega_i2c_cam_ctrl_event(), atmega_i2c_cam_ctrl_send(), autopilot_send_mode(), baro_amsys_read_periodic(), baro_bmp_event(), baro_ets_read_event(), baro_event(), baro_hca_read_event(), baro_mpl3115_read_event(), baro_MS5534A_event(), baro_ms5611_event(), baro_ms5611_send_coeff(), baro_periodic(), baro_scp_event(), calibration(), charge_sens_event(), config_mkk_v2_periodic_telemetry(), dc_info(), dl_parse_msg(), dpicco_event(), dust_gp2y_event(), enose_periodic(), flight_benchmark_periodic(), formation_flight(), geiger_counter_event(), gps_ubx_ucenter_configure(), gsm_event(), hmc5843_module_periodic(), humid_hih_periodic(), humid_htm_event(), humid_sht_event_i2c(), humid_sht_periodic(), humid_sht_periodic_i2c(), imu_apogee_downlink_raw(), IMU_Daten_verarbeiten(), imu_hbmini_downlink_raw(), imu_krooz_downlink_raw(), imu_navgo_downlink_raw(), imu_umarim_downlink_raw(), ir_mlx_event(), ir_mlx_periodic(), light_solar_periodic(), light_temt_periodic(), lm75_event(), mag_hmc58xx_report(), main_periodic(), max11040_periodic(), mf_daq_send_report(), mf_ptu_periodic(), micromag_event(), mission_status_report(), monitor_task(), MPPT_ask(), MPPT_periodic(), nav_catapult_run(), nav_move_waypoint(), navigation_task(), navigation_update_wp_from_speed(), parse_dl_get_setting(), parse_dl_move_wp(), parse_dl_ping(), parse_dl_setting(), parse_ins_msg(), pcap01_event(), periodic_2Hz_openlog(), periodic_downlink_carto(), periodic_report_sysmon(), periodic_telemetry_err_report(), potential_task(), px4flow_downlink(), qr_code_spi_link_periodic(), reporting_task(), Send(), send_airspeed(), send_alive(), send_attitude(), send_bat(), send_cam(), send_desired(), send_dl_value(), send_downlink(), send_energy(), send_estimator(), send_fliter_status(), send_fp(), send_imu_mag_current(), send_rc(), send_rotorcraft_cmd(), send_rotorcraft_rc(), send_status(), sonar_adc_read(), srf08_event(), start_formation(), stop_formation(), tcas_periodic_task_1Hz(), temod_event(), temp_tcouple_adc_periodic(), tmp102_event(), trigger_ext_periodic(), vn100_report_task(), wind_gfi_event(), windturbine_periodic(), and xtend_rssi_periodic().

#define DefaultDevice   DOWNLINK_DEVICE

Definition at line 91 of file downlink.h.

Referenced by adc_generic_periodic(), add_slot(), ahrs_propagate(), ahrs_update_mag(), airspeed_amsys_downlink(), airspeed_ets_read_event(), airspeed_otf_parse(), alt_filter_periodic(), alt_kalman(), aoa_adc_update(), ArduIMU_event(), aspirin2_subsystem_downlink_raw(), atmega_i2c_cam_ctrl_event(), atmega_i2c_cam_ctrl_send(), autopilot_send_mode(), baro_amsys_read_periodic(), baro_bmp_event(), baro_ets_read_event(), baro_event(), baro_hca_read_event(), baro_mpl3115_read_event(), baro_MS5534A_event(), baro_ms5611_event(), baro_ms5611_send_coeff(), baro_periodic(), baro_scp_event(), calibration(), charge_sens_event(), config_mkk_v2_periodic_telemetry(), dc_info(), dl_parse_msg(), dpicco_event(), dust_gp2y_event(), enose_periodic(), flight_benchmark_periodic(), formation_flight(), geiger_counter_event(), gps_ubx_ucenter_configure(), gsm_event(), hmc5843_module_periodic(), humid_hih_periodic(), humid_htm_event(), humid_sht_event_i2c(), humid_sht_periodic(), humid_sht_periodic_i2c(), imu_apogee_downlink_raw(), IMU_Daten_verarbeiten(), imu_hbmini_downlink_raw(), imu_krooz_downlink_raw(), imu_navgo_downlink_raw(), imu_umarim_downlink_raw(), ir_mlx_event(), ir_mlx_periodic(), light_solar_periodic(), light_temt_periodic(), lm75_event(), mag_hmc58xx_report(), main_periodic(), max11040_periodic(), mf_daq_send_report(), mf_ptu_periodic(), micromag_event(), mission_status_report(), monitor_task(), MPPT_ask(), MPPT_periodic(), nav_catapult_run(), nav_move_waypoint(), navigation_task(), navigation_update_wp_from_speed(), parse_dl_get_setting(), parse_dl_move_wp(), parse_dl_ping(), parse_dl_setting(), parse_ins_msg(), pcap01_event(), periodic_2Hz_openlog(), periodic_downlink_carto(), periodic_report_sysmon(), periodic_telemetry_err_report(), potential_task(), px4flow_downlink(), qr_code_spi_link_periodic(), reporting_task(), Send(), send_airspeed(), send_alive(), send_attitude(), send_bat(), send_cam(), send_desired(), send_dl_value(), send_downlink(), send_energy(), send_estimator(), send_fliter_status(), send_fp(), send_imu_mag_current(), send_rc(), send_rotorcraft_cmd(), send_rotorcraft_rc(), send_status(), sonar_adc_read(), srf08_event(), start_formation(), stop_formation(), tcas_periodic_task_1Hz(), temod_event(), temp_tcouple_adc_periodic(), tmp102_event(), trigger_ext_periodic(), vn100_report_task(), wind_gfi_event(), windturbine_periodic(), and xtend_rssi_periodic().

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE

Definition at line 87 of file downlink.h.

#define DownlinkCheckFreeSpace (   _trans,
  _dev,
  _x 
)    Transport(_trans, CheckFreeSpace(_dev, (uint8_t)(_x)))

Definition at line 113 of file downlink.h.

#define DownlinkCountBytes (   _trans,
  _dev,
  _n 
)    downlink_nb_bytes += _n;

Definition at line 155 of file downlink.h.

#define DownlinkEndMessage (   _trans,
  _dev 
)    Transport(_trans, Trailer(_dev))

Definition at line 164 of file downlink.h.

#define DownlinkIDsSize (   _trans,
  _dev,
  _x 
)    (_x+2)

Set of macros for generated code (messages.h) from messages.xml.

2 = ac_id + msg_id

Definition at line 110 of file downlink.h.

#define DownlinkOverrun (   _trans,
  _dev 
)    downlink_nb_ovrn++;

Definition at line 154 of file downlink.h.

#define DownlinkPutCharArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutCharArray(_dev, _n, _x))

Definition at line 140 of file downlink.h.

#define DownlinkPutCharByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutCharByAddr(_dev, _x))

Definition at line 128 of file downlink.h.

#define DownlinkPutCharFixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutCharFixedArray(_dev, _n, _x))

Definition at line 152 of file downlink.h.

#define DownlinkPutDoubleArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutDoubleArray(_dev, _n, _x))

Definition at line 131 of file downlink.h.

#define DownlinkPutDoubleByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutDoubleByAddr(_dev, _x))

Definition at line 125 of file downlink.h.

#define DownlinkPutDoubleFixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutDoubleFixedArray(_dev, _n, _x))

Definition at line 143 of file downlink.h.

#define DownlinkPutFloatArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutFloatArray(_dev, _n, _x))

Definition at line 130 of file downlink.h.

#define DownlinkPutFloatByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutFloatByAddr(_dev, _x))

Definition at line 123 of file downlink.h.

#define DownlinkPutFloatFixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutFloatFixedArray(_dev, _n, _x))

Definition at line 142 of file downlink.h.

#define DownlinkPutInt16Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt16Array(_dev, _n, _x))

Definition at line 132 of file downlink.h.

#define DownlinkPutInt16ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutInt16ByAddr(_dev, _x))

Definition at line 119 of file downlink.h.

#define DownlinkPutInt16FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt16FixedArray(_dev, _n, _x))

Definition at line 144 of file downlink.h.

#define DownlinkPutInt32Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt32Array(_dev, _n, _x))

Definition at line 134 of file downlink.h.

#define DownlinkPutInt32ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutInt32ByAddr(_dev, _x))

Definition at line 121 of file downlink.h.

#define DownlinkPutInt32FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt32FixedArray(_dev, _n, _x))

Definition at line 146 of file downlink.h.

#define DownlinkPutInt64Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt64Array(_dev, _n, _x))

Definition at line 136 of file downlink.h.

#define DownlinkPutInt64ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutInt64ByAddr(_dev, _x))

Definition at line 127 of file downlink.h.

#define DownlinkPutInt64FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt64FixedArray(_dev, _n, _x))

Definition at line 148 of file downlink.h.

#define DownlinkPutInt8Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt8Array(_dev, _n, _x))

Definition at line 138 of file downlink.h.

#define DownlinkPutInt8ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutInt8ByAddr(_dev, _x))

Definition at line 117 of file downlink.h.

#define DownlinkPutInt8FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutInt8FixedArray(_dev, _n, _x))

Definition at line 150 of file downlink.h.

#define DownlinkPutUint16Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint16Array(_dev, _n, _x))

Definition at line 133 of file downlink.h.

#define DownlinkPutUint16ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutUint16ByAddr(_dev, _x))

Definition at line 120 of file downlink.h.

#define DownlinkPutUint16FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint16FixedArray(_dev, _n, _x))

Definition at line 145 of file downlink.h.

#define DownlinkPutUint32Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint32Array(_dev, _n, _x))

Definition at line 135 of file downlink.h.

#define DownlinkPutUint32ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutUint32ByAddr(_dev, _x))

Definition at line 122 of file downlink.h.

#define DownlinkPutUint32FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint32FixedArray(_dev, _n, _x))

Definition at line 147 of file downlink.h.

#define DownlinkPutUint64Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint64Array(_dev, _n, _x))

Definition at line 137 of file downlink.h.

#define DownlinkPutUint64ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutUint64ByAddr(_dev, _x))

Definition at line 126 of file downlink.h.

#define DownlinkPutUint64FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint64FixedArray(_dev, _n, _x))

Definition at line 149 of file downlink.h.

#define DownlinkPutUint8 (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutUint8(_dev, _x))

Definition at line 115 of file downlink.h.

#define DownlinkPutUint8Array (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint8Array(_dev, _n, _x))

Definition at line 139 of file downlink.h.

#define DownlinkPutUint8ByAddr (   _trans,
  _dev,
  _x 
)    Transport(_trans, PutUint8ByAddr(_dev, _x))

Definition at line 118 of file downlink.h.

#define DownlinkPutUint8FixedArray (   _trans,
  _dev,
  _n,
  _x 
)    Transport(_trans, PutUint8FixedArray(_dev, _n, _x))

Definition at line 151 of file downlink.h.

#define DownlinkSizeOf (   _trans,
  _dev,
  _x 
)    Transport(_trans, SizeOf(_dev, DownlinkIDsSize(_trans, _dev, _x)))

Definition at line 111 of file downlink.h.

#define DownlinkStartMessage (   _trans,
  _dev,
  _name,
  msg_id,
  payload_len 
)
Value:
{ \
Transport(_trans, Header(_dev, DownlinkIDsSize(_trans, _dev, payload_len))); \
Transport(_trans, PutUint8(_dev, AC_ID)); \
Transport(_trans, PutNamedUint8(_dev, _name, msg_id)); \
}

Definition at line 157 of file downlink.h.

#define Transport (   _chan,
  _fun 
)    _Transport(_chan, _fun)

Definition at line 105 of file downlink.h.

Variable Documentation

uint16_t downlink_nb_bytes

Definition at line 32 of file downlink.c.

Referenced by send_downlink().

uint16_t downlink_nb_msgs

Definition at line 33 of file downlink.c.

Referenced by send_downlink().

uint8_t downlink_nb_ovrn

Counter of messages not sent because of unavailibity of the output buffer.

Definition at line 31 of file downlink.c.

Referenced by send_downlink().