Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
telemetry_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Gautier Hattenberger
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
29 #ifndef TELEMETRY_COMMON_H
30 #define TELEMETRY_COMMON_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <inttypes.h>
37 #include "std.h"
38 #include "pprzlink/pprzlink_device.h"
39 #include "pprzlink/pprzlink_transport.h"
40 #include "pprzlink/messages.h"
41 
44 typedef void (*telemetry_cb)(struct transport_tx *trans, struct link_device *dev);
45 
48 typedef const char telemetry_msg[64];
49 
51 #define TELEMETRY_NB_CBS 4
52 
56 };
57 
65 };
66 
69 extern void telemetry_reporting_task(void);
70 
78 #if PERIODIC_TELEMETRY
80 #else
81 static inline int8_t register_periodic_telemetry(struct periodic_telemetry *_pt __attribute__((unused)),
82  uint8_t _id __attribute__((unused)), telemetry_cb _cb __attribute__((unused))) { return -1; }
83 #endif
84 
85 #if USE_PERIODIC_TELEMETRY_REPORT
91 extern void periodic_telemetry_err_report(uint8_t _process, uint8_t _mode, uint8_t _id);
92 #endif
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* TELEMETRY_COMMON_H */
99 
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
telemetry_cb slots[TELEMETRY_NB_CBS]
const char telemetry_msg[64]
periodic telemetry msg name definition
#define TELEMETRY_NB_CBS
number of callbacks that can be registered per msg
void telemetry_reporting_task(void)
Periodic task.
Definition: telemetry.c:77
void(* telemetry_cb)(struct transport_tx *trans, struct link_device *dev)
Telemetry callback definition.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:51
uint8_t id
id of telemetry message
struct telemetry_cb_slots * cbs
array of callbacks defined through TELEMETRY_MSG
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.
Definition: telemetry.c:115
uint8_t nb
number of messages
Periodic telemetry structure.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
signed char int8_t
Typedef defining 8 bit char type.
Definition: vl53l1_types.h:103