From 276b30140cef52307ddcec6c93c07757badc3b63 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Fri, 27 Oct 2023 08:38:05 -0400 Subject: [PATCH] Fix VFOMode to check for correct response Previous, VFOMode() was expecting the response `CHKVFO 1` from `rigctld` when running in VFO mode, but in fact `rigctld` responds with the string `1`: $ nc localhost 4532 \chk_vfo 1 Closes la5nta/pat#427 --- rigcontrol/hamlib/rigctld.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rigcontrol/hamlib/rigctld.go b/rigcontrol/hamlib/rigctld.go index 0c5eceb..9eafc2e 100644 --- a/rigcontrol/hamlib/rigctld.go +++ b/rigcontrol/hamlib/rigctld.go @@ -121,7 +121,7 @@ func (r *TCPRig) VFOMode() (bool, error) { if err != nil { return false, err } - return resp == "CHKVFO 1", nil + return strings.TrimPrefix(resp, "CHKVFO ") == "1", nil } // Gets the dial frequency for this VFO.