From 461021fbf46d91b834e01ee8674e3183502647fb Mon Sep 17 00:00:00 2001 From: Nonoo Date: Wed, 4 Nov 2020 12:53:18 +0100 Subject: [PATCH] Fix SWR read --- README.md | 2 +- civcontrol.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed3e82e..80e9813 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ is up) with the following info: - `preamp`: PAMP0 means the preamp is off - `voltage`: Vd voltage, updated when a TX/TUNE is over - `txpwr`: current transmit power setting in percent - - `swr`: reported SWR, it seems that the Icom IC-705 always reports 0.0 + - `swr`: reported SWR - Third status bar line: - `up`: how long the audio/serial connection is active diff --git a/civcontrol.go b/civcontrol.go index de769b5..7a4a6d3 100644 --- a/civcontrol.go +++ b/civcontrol.go @@ -462,7 +462,7 @@ func (s *civControlStruct) decodeVdSWRS(d []byte) bool { if len(d) < 3 { return !s.state.getSWRSent } - statusLog.reportSWR(((float64(int(d[1])<<8) + float64(d[2])) / 0x0241) * 16) + statusLog.reportSWR(((float64(int(d[1])<<8)+float64(d[2]))/0x0120)*2 + 1) if s.state.getSWRSent { s.state.getSWRSent = false return false