feat(cat): make the DTR/RTS lowering a setting
Both defaults break someone. 0.22.7 lowered the lines on Yaesu and Kenwood and silenced a TS-990 whose interface needs RTS raised to transmit; 0.22.8 stopped lowering them and an FT8 station reported its output power wandering, cured by closing OpsLog — Windows raises both on open and the interface reads one as PTT. So it is now a checkbox on those two backends, off by default: that is how they behaved before any of this. Xiegu keeps lowering them unconditionally (its own report, its own explicit keying setting), and the CI-V backend keeps the behaviour it has always had.
This commit is contained in:
+20
-9
@@ -82,9 +82,12 @@ var yaesuModeToADIF = map[byte]string{
|
||||
}
|
||||
|
||||
type Yaesu struct {
|
||||
portName string
|
||||
baud int
|
||||
digital string // ADIF mode reported for DATA (FT8, RTTY…)
|
||||
// lowerLines deasserts DTR and RTS on connect — see Kenwood.lowerLines for
|
||||
// why neither default is safe for every station.
|
||||
lowerLines bool
|
||||
portName string
|
||||
baud int
|
||||
digital string // ADIF mode reported for DATA (FT8, RTTY…)
|
||||
|
||||
mu sync.Mutex
|
||||
port serial.Port
|
||||
@@ -127,6 +130,14 @@ func NewYaesu(portName string, baud int, digital string) *Yaesu {
|
||||
return &Yaesu{portName: strings.TrimSpace(portName), baud: baud, digital: digital, curVFO: "A"}
|
||||
}
|
||||
|
||||
// SetLowerLines chooses whether DTR and RTS are deasserted on connect. Set
|
||||
// before Connect.
|
||||
func (y *Yaesu) SetLowerLines(v bool) {
|
||||
y.mu.Lock()
|
||||
y.lowerLines = v
|
||||
y.mu.Unlock()
|
||||
}
|
||||
|
||||
func (y *Yaesu) Name() string { return "yaesu" }
|
||||
|
||||
func (y *Yaesu) Connect() error {
|
||||
@@ -150,12 +161,12 @@ func (y *Yaesu) Connect() error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("yaesu: open %s @ %d baud: %w", y.portName, y.baud, err)
|
||||
}
|
||||
// The modem lines are LEFT ALONE — see the same note in kenwood.go.
|
||||
//
|
||||
// Deasserting them to keep an interface from keying the rig silenced radios
|
||||
// instead: many USB-serial interfaces will not transmit with RTS low. The
|
||||
// Xiegu fault that change was written for is handled in that backend, which
|
||||
// now has an explicit setting for which line keys the rig.
|
||||
// The modem lines are only touched when the operator asks for it — see the
|
||||
// note on Kenwood.lowerLines. Both defaults break somebody's station.
|
||||
if y.lowerLines {
|
||||
_ = p.SetDTR(false)
|
||||
_ = p.SetRTS(false)
|
||||
}
|
||||
p.SetReadTimeout(300 * time.Millisecond)
|
||||
y.port = p
|
||||
|
||||
|
||||
Reference in New Issue
Block a user