Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
datalink.c
Go to the documentation of this file.
1/*
2 * Copyright (C) Kirk Scheper <kirkscheper@gmail.com>
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
28#define MODULES_DATALINK_C
29
30#include "datalink.h"
32
33#include "generated/modules.h"
34#include "generated/settings.h"
35
36#include "pprzlink/messages.h"
37
42
43#if USE_NPS
44bool datalink_enabled = true;
45#endif
46
47void datalink_init(void)
48{
49 dl_msg_available = false;
50 datalink_time = 0;
52}
53
55{
56 datalink_time++; // called at 1Hz
57}
58
59void datalink_parse_PING(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
60{
61 // Reply to the sender of the message
62 struct pprzlink_msg msg;
63 msg.trans = trans;
64 msg.dev = dev;
65 msg.sender_id = AC_ID;
66 msg.receiver_id = pprzlink_get_msg_sender_id(buf);
67 msg.component_id = 0;
69}
70
71void WEAK dl_parse_msg(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
72{
73 uint8_t msg_id = pprzlink_get_msg_id(buf);
75 /* Parse modules datalink */
76 modules_parse_datalink(msg_id, class_id, dev, trans, buf);
77}
78
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
#define MSG_SIZE
Definition main_demo5.c:62
uint16_t foo
Definition main_demo5.c:58
static const struct usb_device_descriptor dev
Definition usb_ser_hw.c:74
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.