Paparazzi UAS  v5.15_devel-47-g0391b4d
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
telemetry_common.h File Reference

Common tools for periodic telemetry interface Allows subsystem to register callback functions. More...

#include <inttypes.h>
#include "std.h"
#include "pprzlink/pprzlink_device.h"
#include "pprzlink/pprzlink_transport.h"
#include "pprzlink/messages.h"
+ Include dependency graph for telemetry_common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  telemetry_cb_slots
 
struct  periodic_telemetry
 Periodic telemetry structure. More...
 

Macros

#define TELEMETRY_NB_CBS   4
 number of callbacks that can be registered per msg More...
 

Typedefs

typedef void(* telemetry_cb )(struct transport_tx *trans, struct link_device *dev)
 Telemetry callback definition. More...
 
typedef const char telemetry_msg [64]
 periodic telemetry msg name definition More...
 

Functions

int8_t register_periodic_telemetry (struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
 Register a telemetry callback function. More...
 
void periodic_telemetry_err_report (uint8_t _process, uint8_t _mode, uint8_t _id)
 Send an error report when trying to send message that as not been register. More...
 

Detailed Description

Common tools for periodic telemetry interface Allows subsystem to register callback functions.

Definition in file telemetry_common.h.


Data Structure Documentation

struct telemetry_cb_slots

Definition at line 53 of file telemetry_common.h.

+ Collaboration diagram for telemetry_cb_slots:
Data Fields
uint8_t id id of telemetry message
telemetry_cb slots[TELEMETRY_NB_CBS]
struct periodic_telemetry

Periodic telemetry structure.

Contains the total number of messages (from generated telemetry file) and the list of registered callbacks

Definition at line 62 of file telemetry_common.h.

+ Collaboration diagram for periodic_telemetry:
Data Fields
struct telemetry_cb_slots * cbs array of callbacks defined through TELEMETRY_MSG
uint8_t nb number of messages

Macro Definition Documentation

#define TELEMETRY_NB_CBS   4

number of callbacks that can be registered per msg

Definition at line 51 of file telemetry_common.h.

Referenced by register_periodic_telemetry().

Typedef Documentation

typedef void(* telemetry_cb)(struct transport_tx *trans, struct link_device *dev)

Telemetry callback definition.

Definition at line 44 of file telemetry_common.h.

typedef const char telemetry_msg[64]

periodic telemetry msg name definition

Definition at line 48 of file telemetry_common.h.

Function Documentation

void periodic_telemetry_err_report ( uint8_t  _process,
uint8_t  _mode,
uint8_t  _id 
)

Send an error report when trying to send message that as not been register.

Parameters
_processtelemetry process id
_modetelemetry mode
_idid of the message
_processtelemetry process id
_modetelemetry mode
_idid of the message in telemetry system (see var/<AC>/generated/periodic_telemetry.h)

Definition at line 78 of file telemetry.c.

References DefaultChannel, DefaultDevice, and mode.

int8_t register_periodic_telemetry ( struct periodic_telemetry _pt,
uint8_t  _id,
telemetry_cb  _cb 
)

Register a telemetry callback function.

empty implementation is provided if PERIODIC_TELEMETRY is not set or set to FALSE

Parameters
_ptperiodic telemetry structure to register
<em>idmessage ID (use PPRZ_MSG_ID<message_name> define)
_cbcallback function, called according to telemetry mode and specified period
Returns
-1 on failure to register, index of callback otherwise
Parameters
_ptperiodic telemetry structure to register
<em>idmessage ID (use PPRZ_MSG_ID<message_name> define)
_cbcallback function, called according to telemetry mode and specified period
Returns
-1 on failure to register, index of callback otherwise

Definition at line 46 of file telemetry.c.

References periodic_telemetry::cbs, telemetry_cb_slots::id, periodic_telemetry::nb, telemetry_cb_slots::slots, and TELEMETRY_NB_CBS.

Referenced by actuators_bebop_init(), adc_generic_init(), ahrs_aligner_init(), ahrs_dcm_register(), ahrs_fc_register(), ahrs_float_invariant_register(), ahrs_ice_register(), ahrs_icq_register(), ahrs_infrared_init(), ahrs_mlkf_register(), ahrs_vectornav_init(), ahrs_vectornav_register(), air_data_init(), aoa_pwm_init(), autopilot_firmware_init(), autopilot_init(), battery_monitor_init(), bluegiga_init(), cam_init(), dcf_init(), detect_gate_init(), digital_cam_uart_init(), downlink_init(), dragspeed_init(), esc32_init(), gec_dl_init(), gps_init(), gps_piksi_init(), guidance_h_init(), guidance_hybrid_init(), guidance_v_init(), gvf_init(), h_ctl_init(), hff_init(), i2c_init(), imu_gx3_init(), imu_init(), imu_vectornav_init(), init_fbw(), ins_ekf2_init(), ins_float_invariant_init(), ins_float_invariant_wrapper_init(), ins_gps_passthrough_init(), ins_int_init(), ins_mekf_wind_wrapper_init(), ins_vectornav_init(), intermcu_init(), jevois_mavlink_init(), link_mcu_init(), mag_pitot_init(), main_init(), mavlink_init(), motor_mixing_init(), ms45xx_i2c_init(), nav_init(), nav_rover_init(), nav_survey_rectangle_rotorcraft_init(), navdata_init(), optical_flow_hover_init(), opticflow_module_init(), radio_control_impl_init(), relative_localization_filter_init(), rotorcraft_cam_init(), rpm_sensor_init(), sdlog_chibios_init(), sdp3x_init(), stabilization_attitude_init(), stabilization_indi_init(), stabilization_rate_init(), superbitrf_init(), temp_adc_init(), tfmini_init(), throttle_curve_init(), uart_periph_init(), vertical_ctrl_module_init(), vff_init(), and wind_estimator_init().