fix: CAT PTT not working for DVK

This commit is contained in:
2026-07-09 08:18:49 +02:00
parent f665d666d6
commit 1f5e5759cc
2 changed files with 23 additions and 1 deletions
+13 -1
View File
@@ -5844,8 +5844,20 @@ func (a *App) TestPTT(cfg AudioSettings) error {
if err := a.pttKey(cfg); err != nil {
return err
}
// Hold long enough to be observable. OmniRig is async and coalesces rapid
// writes to the same parameter: it stores the desired Tx value and flushes
// on its own poll timer, so a key (PM_TX) followed too quickly by an unkey
// (PM_RX) can land in ONE flush cycle — OmniRig then sends only the last
// value (PM_RX) and the rig never actually transmits (while an already-MOX'd
// rig gets dropped by that lone PM_RX). A longer hold guarantees the key
// command is sent and held before the release. Serial RTS/DTR is instant,
// so it keeps the short window.
hold := 600 * time.Millisecond
if cfg.PTTMethod == "cat" {
hold = 1500 * time.Millisecond
}
gen := a.pttGenNow()
go func() { time.Sleep(600 * time.Millisecond); a.unkeyIfCurrent(gen) }()
go func() { time.Sleep(hold); a.unkeyIfCurrent(gen) }()
return nil
}