package cat import "testing" // What SPLIT means when the operator presses it. // // Flipping the rig's split flag alone transmits wherever the OTHER VFO happens // to sit — reported from a real FTDX10: listening on 14.244 with VFO B left on // 18.115 from an earlier session, pressing SPLIT threw the transmitter onto // another band. The other VFO is stale by nature, so the transmit frequency has // to be derived from where the operator is listening now. func TestYaesuDefaultSplitOffset(t *testing.T) { cases := []struct { raw string want int64 }{ // CW and the data modes work 1 kHz up. {"CW-U", 1000}, {"CW-L", 1000}, {"RTTY-U", 1000}, {"RTTY-L", 1000}, {"DATA-U", 1000}, {"DATA-L", 1000}, // Phone works 5 kHz up. {"USB", 5000}, {"LSB", 5000}, {"AM", 5000}, {"FM", 5000}, // Unknown or not yet read: the phone offset is the safer default — too // wide is audible and obvious, too narrow lands on top of the DX. {"", 5000}, } for _, c := range cases { y := &Yaesu{} y.panel.RawMode = c.raw if got := y.defaultSplitOffset(); got != c.want { t.Errorf("mode %q → split offset %d Hz, want %d", c.raw, got, c.want) } } }