Skip to content
GitLab
Menu
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
9ad93cf0
Commit
9ad93cf0
authored
Apr 18, 2017
by
Gus Grubba
Browse files
RC noise and remote noise are defined as “unsigned”. Handle them as such.
parent
83b22d62
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/MAVLinkProtocol.cc
View file @
9ad93cf0
...
...
@@ -213,8 +213,10 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
// process telemetry status message
mavlink_radio_status_t
rstatus
;
mavlink_msg_radio_status_decode
(
&
message
,
&
rstatus
);
int
rssi
=
rstatus
.
rssi
,
remrssi
=
rstatus
.
remrssi
;
int
rssi
=
rstatus
.
rssi
;
int
remrssi
=
rstatus
.
remrssi
;
int
noise
=
rstatus
.
noise
;
int
remnoise
=
rstatus
.
remnoise
;
// 3DR Si1k radio needs rssi fields to be converted to dBm
if
(
message
.
sysid
==
'3'
&&
message
.
compid
==
'D'
)
{
/* Per the Si1K datasheet figure 23.25 and SI AN474 code
...
...
@@ -230,12 +232,13 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
rssi
=
qMin
(
qMax
(
qRound
(
static_cast
<
qreal
>
(
rssi
)
/
1.9
-
127.0
),
-
120
),
0
);
remrssi
=
qMin
(
qMax
(
qRound
(
static_cast
<
qreal
>
(
remrssi
)
/
1.9
-
127.0
),
-
120
),
0
);
}
else
{
rssi
=
(
int8_t
)
rstatus
.
rssi
;
remrssi
=
(
int8_t
)
rstatus
.
remrssi
;
rssi
=
(
int8_t
)
rstatus
.
rssi
;
remrssi
=
(
int8_t
)
rstatus
.
remrssi
;
noise
=
(
int8_t
)
rstatus
.
noise
;
remnoise
=
(
int8_t
)
rstatus
.
remnoise
;
}
emit
radioStatusChanged
(
link
,
rstatus
.
rxerrors
,
rstatus
.
fixed
,
rssi
,
remrssi
,
rstatus
.
txbuf
,
rstatus
.
noise
,
rstatus
.
remnoise
);
rstatus
.
txbuf
,
noise
,
remnoise
);
}
#ifndef __mobile__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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