Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
87d277ff
Commit
87d277ff
authored
Apr 16, 2011
by
Andrew Tridgell
Browse files
mavlink: report bad message lengths to the console
parent
4a8673db
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/MAVLinkProtocol.cc
View file @
87d277ff
...
...
@@ -182,6 +182,14 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
unsigned
int
decodeState
=
mavlink_parse_char
(
link
->
getId
(),
(
uint8_t
)(
b
.
at
(
position
)),
&
message
,
&
status
);
if
(
decodeState
==
1
)
{
#ifdef MAVLINK_MESSAGE_LENGTHS
const
uint8_t
message_lengths
[]
=
MAVLINK_MESSAGE_LENGTHS
;
if
(
message
.
msgid
>=
sizeof
(
message_lengths
)
||
message
.
len
!=
message_lengths
[
message
.
msgid
])
{
qDebug
()
<<
"MAVLink message "
<<
message
.
msgid
<<
" length incorrect (was "
<<
message
.
len
<<
" expected "
<<
message_lengths
[
message
.
msgid
]
<<
")"
;
continue
;
}
#endif
// Log data
if
(
m_loggingEnabled
&&
m_logfile
)
{
const
int
len
=
MAVLINK_MAX_PACKET_LEN
+
sizeof
(
quint64
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment