mavtables
0.2.1
MAVLink router and firewall.
src
mavlink.hpp
Go to the documentation of this file.
1
// MAVLink router and firewall.
2
// Copyright (C) 2018 Michael R. Shannon <mrshannon.aerospace@gmail.com>
3
//
4
// This program is free software; you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation; either version 2 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
18
#ifndef MAVLINK_H_
19
#define MAVLINK_H_
20
21
22
extern
"C"
23
{
24
25
#define MAVLINK_USE_MESSAGE_INFO
26
#include "mavlink.h"
27
28
}
29
30
#include <cstdint>
31
#include "
macros.hpp
"
32
33
namespace
mavlink
34
{
35
36
/** \defgroup mavlink MAVLink Library and Helpers
37
*
38
* MAVLink utility macros, defines, types and functions.
39
*
40
* Including this file also includes the main MAVLink C library. This will
41
* be the reference implementation using the ArduPilot dialect by default.
42
*
43
* The dialect can be changed by setting the `DIALECT` environment
44
* variable. The default is `ardupilotmega`.
45
*
46
* The MAVLink library can be changed with the `MDIR` environement variable
47
* which should point to the directory where the `DIALECT` directory can be
48
* found.
49
*/
50
51
52
/** MAVLink packet v1.0 header.
53
*
54
* \ingroup mavlink
55
*/
56
struct
PACKED
v1_header
57
{
58
uint8_t
magic
;
//!< Protocol magic marker (0xFE).
59
uint8_t
len
;
//!< Length of payload.
60
uint8_t
seq
;
//!< Sequence of packet.
61
uint8_t
sysid
;
//!< ID of message sender system/aircraft.
62
uint8_t
compid
;
//!< ID of the message sneder component.
63
uint8_t
msgid
;
//!< ID of message in payload.
64
};
65
66
67
/** MAVLink packet v2.0 header.
68
*
69
* \ingroup mavlink
70
*/
71
struct
PACKED
v2_header
72
{
73
uint8_t
magic
;
//!< Protocol magic marker (0xFD).
74
uint8_t
len
;
//!< Length of payload.
75
uint8_t
incompat_flags
;
//!< Flags that must be understood.
76
uint8_t
compat_flags
;
//!< Flags that can be ignored if not known.
77
uint8_t
seq
;
//!< Sequence of packet.
78
uint8_t
sysid
;
//!< ID of message sender system/aircraft.
79
uint8_t
compid
;
//!< ID of the message sender component.
80
uint32_t
msgid
: 24;
//!< ID of message in payload (3 bytes).
81
};
82
83
84
std::string
name
(
unsigned
long
id
);
85
unsigned
long
id
(std::string
name
);
86
87
}
88
89
#endif // MAVLINK_H_
mavlink::v1_header::sysid
uint8_t sysid
ID of message sender system/aircraft.
Definition:
mavlink.hpp:61
mavlink::v1_header
Definition:
mavlink.hpp:56
mavlink::v2_header
Definition:
mavlink.hpp:71
mavlink::name
std::string name(unsigned long id)
Definition:
mavlink.cpp:35
mavlink::id
unsigned long id(std::string name)
Definition:
mavlink.cpp:57
mavlink::v2_header::seq
uint8_t seq
Sequence of packet.
Definition:
mavlink.hpp:77
mavlink::v2_header::sysid
uint8_t sysid
ID of message sender system/aircraft.
Definition:
mavlink.hpp:78
mavlink::v1_header::magic
uint8_t magic
Protocol magic marker (0xFE).
Definition:
mavlink.hpp:58
mavlink::v1_header::len
uint8_t len
Length of payload.
Definition:
mavlink.hpp:59
mavlink::v2_header::msgid
uint32_t msgid
ID of message in payload (3 bytes).
Definition:
mavlink.hpp:80
macros.hpp
mavlink::v2_header::compat_flags
uint8_t compat_flags
Flags that can be ignored if not known.
Definition:
mavlink.hpp:76
mavlink::v1_header::seq
uint8_t seq
Sequence of packet.
Definition:
mavlink.hpp:60
mavlink::v1_header::msgid
uint8_t msgid
ID of message in payload.
Definition:
mavlink.hpp:63
mavlink::v2_header::len
uint8_t len
Length of payload.
Definition:
mavlink.hpp:74
mavlink
Definition:
mavlink.cpp:25
PACKED
#define PACKED
Definition:
macros.hpp:41
mavlink::v2_header::magic
uint8_t magic
Protocol magic marker (0xFD).
Definition:
mavlink.hpp:73
mavlink::v1_header::compid
uint8_t compid
ID of the message sneder component.
Definition:
mavlink.hpp:62
mavlink::v2_header::compid
uint8_t compid
ID of the message sender component.
Definition:
mavlink.hpp:79
mavlink::v2_header::incompat_flags
uint8_t incompat_flags
Flags that must be understood.
Definition:
mavlink.hpp:75
Generated by
1.8.14