Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
extra_pprz_dl.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 Pascal Brisset, Antoine Drouin
3  * Copyright (C) 2010 ENAC
4  * Copyright (C) 2016 2016 Michal Podhradsky <http://github.com/podhrmic>
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
44 #define PERIODIC_C_EXTRA
45 
48 
49 // By default don't update datalink_time when receiving messages from extra datalink
50 #ifndef EXTRA_PPRZ_UPDATE_DL
51 #define EXTRA_PPRZ_UPDATE_DL FALSE
52 #endif
53 
55 uint8_t extra_dl_buffer[MSG_SIZE] __attribute__((aligned));
56 
57 struct pprz_transport extra_pprz_tp;
58 
60 {
61  pprz_transport_init(&extra_pprz_tp);
62 }
63 
64 
66 {
67  pprz_check_and_parse(&EXTRA_DOWNLINK_DEVICE.device, &extra_pprz_tp, extra_dl_buffer, &extra_dl_msg_available);
68  DlCheckAndParse(&EXTRA_DOWNLINK_DEVICE.device, &extra_pprz_tp.trans_tx, extra_dl_buffer, &extra_dl_msg_available, EXTRA_PPRZ_UPDATE_DL);
69 }
70 
71 
73 {
74 #if PERIODIC_TELEMETRY && defined(TELEMETRY_PROCESS_Extra)
75  // send periodic messages as defined in the Extra process, we are using DefaultPeriodic so we can send standard messages
76  periodic_telemetry_send_Extra(DefaultPeriodic, &extra_pprz_tp.trans_tx, &(EXTRA_DOWNLINK_DEVICE).device);
77 #endif
78 }
EXTRA_PPRZ_UPDATE_DL
#define EXTRA_PPRZ_UPDATE_DL
Definition: extra_pprz_dl.c:51
extra_pprz_dl_init
void extra_pprz_dl_init(void)
Init function.
Definition: extra_pprz_dl.c:59
extra_dl_msg_available
bool extra_dl_msg_available
Definition: extra_pprz_dl.c:54
extra_pprz_dl.h
MSG_SIZE
#define MSG_SIZE
Definition: main_demo5.c:63
telemetry.h
extra_pprz_dl_periodic
void extra_pprz_dl_periodic(void)
Periodic function.
Definition: extra_pprz_dl.c:72
uint8_t
unsigned char uint8_t
Definition: types.h:14
extra_pprz_tp
struct pprz_transport extra_pprz_tp
Definition: extra_pprz_dl.c:57
extra_dl_buffer
uint8_t extra_dl_buffer[MSG_SIZE]
Definition: extra_pprz_dl.c:55
extra_pprz_dl_event
void extra_pprz_dl_event(void)
Datalink Event.
Definition: extra_pprz_dl.c:65
DefaultPeriodic
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66