Paparazzi UAS  v5.8.2_stable-0-g6260b7c
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 "mcu_periph/link_device.h"
#include "subsystems/datalink/transport.h"
#include "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

static 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 49 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 58 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 47 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 40 of file telemetry_common.h.

typedef const char telemetry_msg[64]

periodic telemetry msg name definition

Definition at line 44 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, and DefaultDevice.

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

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

Definition at line 73 of file telemetry_common.h.