fix(kenwood): split frequencies swapped on transmit
IF reports the VFO "in use". In split that is the RECEIVE VFO while receiving and the TRANSMIT VFO while transmitting — the backend took it as the receive VFO in both cases. Everything therefore read correctly until the PTT closed and then reversed, which is exactly how it was reported from a TS-590 on USB. The IF frame has carried the transmit bit all along; parseKenwoodIF already decoded it into f.TX. It was simply never consulted here. This is not only a display fault. FreqHz is what a QSO is LOGGED on, so a contact worked in split went into the log on the DX's frequency instead of the operator's — wrong in the log, wrong in every ADIF exported from it, and invisible until someone checked a QSO by hand. The emulated rig in the test package can now be keyed, so the case is pinned from both sides: verified failing without the fix (tx and rx exchanged) and passing with it.
This commit is contained in:
+24
-4
@@ -377,16 +377,36 @@ func (k *Kenwood) ReadState() (RigState, error) {
|
||||
f.Split = split
|
||||
|
||||
if f.Split {
|
||||
// The transmit VFO is the other one. Read it rather than assume, and fall
|
||||
// back to simplex if it cannot be read: a wrong TX frequency is written
|
||||
// into the log, which is worse than showing no split at all.
|
||||
// The OTHER VFO is the one IF did not report. Read it rather than assume,
|
||||
// and fall back to simplex if it cannot be read: a wrong TX frequency is
|
||||
// written into the log, which is worse than showing no split at all.
|
||||
other := "FB;"
|
||||
if f.VFO == "B" {
|
||||
other = "FA;"
|
||||
}
|
||||
var otherHz int64
|
||||
if r, err := k.ask(other); err == nil {
|
||||
if hz, ok := parseKenwoodFreq(r, strings.TrimSuffix(other, ";")); ok && hz > 0 && hz != rx {
|
||||
tx = hz
|
||||
otherHz = hz
|
||||
}
|
||||
}
|
||||
if otherHz > 0 {
|
||||
// WHICH of the two is the transmit frequency depends on whether the rig
|
||||
// is transmitting RIGHT NOW.
|
||||
//
|
||||
// IF reports the VFO "in use", and in split that is the RECEIVE VFO on
|
||||
// receive and the TRANSMIT VFO on transmit. The code took it as the
|
||||
// receive VFO always, so the moment the operator keyed up the two
|
||||
// frequencies swapped: correct on receive, reversed on transmit, which
|
||||
// is exactly how it was reported from a TS-590 on USB.
|
||||
//
|
||||
// It matters beyond the display. FreqHz is what a QSO is logged on, and
|
||||
// a contact made in split would have gone into the log on the DX's
|
||||
// frequency instead of the operator's.
|
||||
if f.TX {
|
||||
tx, rx = rx, otherHz
|
||||
} else {
|
||||
tx = otherHz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user