From 9ad93cf00135cde7560b1b92ad83aa8157954a9d Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Tue, 18 Apr 2017 21:11:28 -0400 Subject: [PATCH] =?UTF-8?q?RC=20noise=20and=20remote=20noise=20are=20defin?= =?UTF-8?q?ed=20as=20=E2=80=9Cunsigned=E2=80=9D.=20Handle=20them=20as=20su?= =?UTF-8?q?ch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/comm/MAVLinkProtocol.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 3f195cd1b..faab603bc 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -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(rssi) / 1.9 - 127.0), - 120), 0); remrssi = qMin(qMax(qRound(static_cast(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__ -- 2.22.0