fix: RX and TX both on SUB is simplex, not split

Reported on an FTDX101: with RX and TX moved together to the sub VFO, OpsLog
showed split — and took the MAIN frequency as the transmit one, which would log
the wrong frequency.

ST is a bare flag. It says "split" without saying which VFO transmits, and this
rig raises it whenever the transmit VFO is the sub one, whether or not the
operator is also listening there. FT names the transmit VFO, so where the receive
VFO is known as well (FR), split is derived from the pair: they differ or they do
not. That is a fact about the rig's state rather than a flag whose meaning varies
by model.

The fix is therefore in the probe ORDER, not in the reading: FT is asked first
when FR answered, and ST stays the fallback for rigs that have neither. A test
pins the order and both halves of the trap — that FT gets this case right, and
that ST alone gets it wrong.
This commit is contained in:
2026-07-29 22:10:21 +02:00
parent 2d7469a7f7
commit b0da6a3d14
3 changed files with 59 additions and 3 deletions
+40
View File
@@ -307,3 +307,43 @@ func TestYaesuActiveVFOFollowsReceiveVFO(t *testing.T) {
}
}
}
// Which split command to ASK, given what else the rig answers.
//
// ST is a bare flag and its meaning varies: an FTDX101 with RX and TX both on
// SUB reports ST1, which is plain simplex on the sub VFO, and OpsLog showed
// split with the main frequency as the transmit one (F4NBZ, 2026-07-29).
//
// FT names the transmit VFO. Where the receive VFO is known too (FR), split is
// derived from the pair — they differ or they do not — which is a fact about the
// rig rather than a flag to be interpreted. So FT is preferred when FR answered.
func TestYaesuSplitProbeOrder(t *testing.T) {
order := func(rxVFOCmd string) []string {
if rxVFOCmd != "" {
return []string{"FT", "ST"}
}
return []string{"ST", "FT"}
}
if got := order("FR")[0]; got != "FT" {
t.Errorf("with FR available the first split probe is %q, want FT", got)
}
if got := order("")[0]; got != "ST" {
t.Errorf("without FR the first split probe is %q, want ST", got)
}
// Both remain available: a rig answering only one must still be handled.
for _, rx := range []string{"FR", ""} {
if len(order(rx)) != 2 {
t.Errorf("rxVFOCmd=%q: both probes must remain, got %v", rx, order(rx))
}
}
// The case that was reported, end to end: RX and TX both on sub is NOT split.
if yaesuSplitFromReply("FT1;", "FT", "B") {
t.Error("RX and TX both on SUB reported as split")
}
// And the flag alone would have got it wrong, which is why the order changed.
if !yaesuSplitFromReply("ST1;", "ST", "B") {
t.Error("ST1 is a flag and reads as split whatever the VFO — that is the trap")
}
}