Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
plugins
DataLoadULog
ulog_messages.h
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* Copyright (c) 2016 PX4 Development Team. All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
*
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* 2. Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in
13
* the documentation and/or other materials provided with the
14
* distribution.
15
* 3. Neither the name PX4 nor the names of its contributors may be
16
* used to endorse or promote products derived from this software
17
* without specific prior written permission.
18
*
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
* POSSIBILITY OF SUCH DAMAGE.
31
*
32
****************************************************************************/
33
34
#pragma once
35
36
#include <cstdint>
37
38
enum class
ULogMessageType
: uint8_t {
39
FORMAT
=
'F'
,
40
DATA
=
'D'
,
41
INFO
=
'I'
,
42
INFO_MULTIPLE
=
'M'
,
43
PARAMETER
=
'P'
,
44
ADD_LOGGED_MSG
=
'A'
,
45
REMOVE_LOGGED_MSG
=
'R'
,
46
SYNC
=
'S'
,
47
DROPOUT
=
'O'
,
48
LOGGING
=
'L'
,
49
FLAG_BITS
=
'B'
,
50
};
51
52
53
/* declare message data structs with byte alignment (no padding) */
54
#pragma pack(push, 1)
55
57
struct
ulog_file_header_s
{
58
uint8_t
magic
[8];
59
uint64_t
timestamp
;
60
};
61
62
#define ULOG_MSG_HEADER_LEN 3 //accounts for msg_size and msg_type
63
struct
ulog_message_header_s
{
64
uint16_t
msg_size
;
65
uint8_t
msg_type
;
66
};
67
68
struct
ulog_message_format_s
{
69
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
70
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::FORMAT
);
71
72
char
format
[1500];
73
};
74
75
struct
ulog_message_add_logged_s
{
76
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
77
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::ADD_LOGGED_MSG
);
78
79
uint8_t
multi_id
;
80
uint16_t
msg_id
;
81
char
message_name[255];
82
};
83
84
struct
ulog_message_remove_logged_s
{
85
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
86
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::REMOVE_LOGGED_MSG
);
87
88
uint16_t
msg_id
;
89
};
90
91
struct
ulog_message_sync_s
{
92
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
93
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::SYNC
);
94
95
uint8_t sync_magic[8];
96
};
97
98
struct
ulog_message_dropout_s
{
99
uint16_t msg_size =
sizeof
(uint16_t);
//size of message - ULOG_MSG_HEADER_LEN
100
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::DROPOUT
);
101
102
uint16_t
duration
;
//in ms
103
};
104
105
struct
ulog_message_data_header_s
{
106
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
107
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::DATA
);
108
109
uint16_t
msg_id
;
110
};
111
112
struct
ulog_message_info_header_s
{
113
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
114
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::INFO
);
115
116
uint8_t
key_len
;
117
char
key[255];
118
};
119
120
struct
ulog_message_info_multiple_header_s
{
121
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
122
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::INFO_MULTIPLE
);
123
124
uint8_t
is_continued
;
125
uint8_t
key_len
;
126
char
key[255];
127
};
128
129
struct
ulog_message_logging_s
{
130
uint16_t
msg_size
;
//size of message - ULOG_MSG_HEADER_LEN
131
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::LOGGING
);
132
133
uint8_t
log_level
;
//same levels as in the linux kernel
134
uint64_t
timestamp
;
135
char
message[128];
//defines the maximum length of a logged message string
136
};
137
138
struct
ulog_message_parameter_header_s
{
139
uint16_t
msg_size
;
140
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::PARAMETER
);
141
142
uint8_t
key_len
;
143
char
key[255];
144
};
145
146
147
#define ULOG_INCOMPAT_FLAG0_DATA_APPENDED_MASK (1<<0)
148
149
struct
ulog_message_flag_bits_s
{
150
uint16_t
msg_size
;
151
uint8_t
msg_type
=
static_cast<
uint8_t
>
(
ULogMessageType::FLAG_BITS
);
152
153
uint8_t compat_flags[8];
154
uint8_t incompat_flags[8];
155
uint64_t appended_offsets[3];
156
};
157
158
#pragma pack(pop)
ulog_message_logging_s::log_level
uint8_t log_level
Definition:
ulog_messages.h:133
ULogMessageType::REMOVE_LOGGED_MSG
ulog_file_header_s::timestamp
uint64_t timestamp
Definition:
ulog_messages.h:59
ulog_message_add_logged_s::msg_id
uint16_t msg_id
Definition:
ulog_messages.h:80
ulog_message_format_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:69
ULogMessageType::FORMAT
ulog_message_logging_s
Definition:
ulog_messages.h:129
ulog_message_add_logged_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:76
ulog_message_logging_s::timestamp
uint64_t timestamp
Definition:
ulog_messages.h:134
ulog_message_format_s
Definition:
ulog_messages.h:68
ulog_message_add_logged_s::multi_id
uint8_t multi_id
Definition:
ulog_messages.h:79
ulog_message_parameter_header_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:139
ulog_message_info_multiple_header_s::is_continued
uint8_t is_continued
can be used for arrays: set to 1, if this message is part of the previous with the same key ...
Definition:
ulog_messages.h:124
ulog_message_add_logged_s
Definition:
ulog_messages.h:75
ULogMessageType::DROPOUT
ulog_message_dropout_s
Definition:
ulog_messages.h:98
ulog_message_info_multiple_header_s::key_len
uint8_t key_len
Definition:
ulog_messages.h:125
ulog_message_header_s::msg_type
uint8_t msg_type
Definition:
ulog_messages.h:65
ulog_message_data_header_s
Definition:
ulog_messages.h:105
ulog_message_flag_bits_s
Definition:
ulog_messages.h:149
ULogMessageType::LOGGING
ulog_message_remove_logged_s
Definition:
ulog_messages.h:84
ULogMessageType::FLAG_BITS
ulog_message_dropout_s::duration
uint16_t duration
Definition:
ulog_messages.h:102
ulog_file_header_s
Definition:
ulog_messages.h:57
ulog_message_info_multiple_header_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:121
format
std::string format(const std::string &, const time_point< seconds > &, const femtoseconds &, const time_zone &)
ULogMessageType
ULogMessageType
Definition:
ulog_messages.h:38
magic
uintptr_t magic
ULogMessageType::PARAMETER
ulog_message_remove_logged_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:85
ulog_message_sync_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:92
ULogMessageType::SYNC
ulog_message_info_header_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:113
ulog_message_parameter_header_s::key_len
uint8_t key_len
Definition:
ulog_messages.h:142
msg_type
def msg_type(f)
ULogMessageType::INFO_MULTIPLE
ulog_message_flag_bits_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:150
ulog_message_info_header_s
Definition:
ulog_messages.h:112
ULogMessageType::ADD_LOGGED_MSG
ulog_message_data_header_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:106
ULogMessageType::INFO
ULogMessageType::DATA
ulog_message_info_header_s::key_len
uint8_t key_len
Definition:
ulog_messages.h:116
ulog_message_parameter_header_s
Definition:
ulog_messages.h:138
ulog_message_info_multiple_header_s
Definition:
ulog_messages.h:120
ulog_message_data_header_s::msg_id
uint16_t msg_id
Definition:
ulog_messages.h:109
ulog_message_header_s
Definition:
ulog_messages.h:63
ulog_message_sync_s
Definition:
ulog_messages.h:91
ulog_message_remove_logged_s::msg_id
uint16_t msg_id
Definition:
ulog_messages.h:88
ulog_message_logging_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:130
ulog_message_header_s::msg_size
uint16_t msg_size
Definition:
ulog_messages.h:64
plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18