fix: the FTDX10 refuses KY; — stop waiting on a status it will never send
The log settled it: the rig answers "?;" — its "unknown command" — to KY; and to MG;. So the keyer status query cannot work on this model, and every send spent four seconds waiting for an answer that was never coming. "?;" is now recognised as what it is. A command refused once is never asked again: models implement different subsets, and re-asking costs a 600 ms timeout on every slow beat for a control that will never answer — which is also why the panel felt sluggish. Without a buffer status there is still a real constraint: one KY command carries 24 characters and the rig DROPS the rest silently. So the send is now paced by how long the text takes to key, from PARIS timing at the rig's own speed. A long macro goes out complete instead of losing its tail. That leaves the question the log cannot answer: whether KY <text>; itself is accepted. If the rig also replies "?;" to it, the CAT menu's PC KEYING setting is the next suspect — but nothing in the code will be guessing at it.
This commit is contained in:
@@ -36,6 +36,7 @@ package cat
|
||||
// read as a hypothesis with a log line attached.
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -101,6 +102,8 @@ type Yaesu struct {
|
||||
panel YaesuTXState
|
||||
panelCycle int
|
||||
panelLoaded bool
|
||||
// Commands this rig answered "?;" to — asked once, then never again.
|
||||
unsupported map[string]bool
|
||||
}
|
||||
|
||||
func NewYaesu(portName string, baud int, digital string) *Yaesu {
|
||||
@@ -324,6 +327,13 @@ func (y *Yaesu) ask(cmd string) (string, error) {
|
||||
}
|
||||
frame := string(buf[:i+1])
|
||||
buf = buf[i+1:]
|
||||
// "?;" is the rig saying it does not know this command. Confirmed on an
|
||||
// FTDX10, which answers it to KY; and MG;. Reporting it as such — rather
|
||||
// than discarding it and waiting out the timeout — is what lets callers
|
||||
// stop asking instead of paying 600 ms per poll for ever.
|
||||
if strings.TrimSpace(frame) == "?;" {
|
||||
return "", errYaesuUnsupported
|
||||
}
|
||||
if want == "" || strings.HasPrefix(strings.ToUpper(frame), want) {
|
||||
return frame, nil
|
||||
}
|
||||
@@ -336,6 +346,11 @@ func (y *Yaesu) ask(cmd string) (string, error) {
|
||||
return "", fmt.Errorf("yaesu: timeout answering %q", cmd)
|
||||
}
|
||||
|
||||
// errYaesuUnsupported is returned when the rig answers "?;" — it does not know
|
||||
// the command. Different models implement different subsets, and the only
|
||||
// reliable way to learn which is to ask once and remember the refusal.
|
||||
var errYaesuUnsupported = errors.New("yaesu: command not supported by this rig")
|
||||
|
||||
// cmdPrefix is the leading letters of a command — what its reply starts with.
|
||||
// "FA;" → "FA", "MD0;" → "MD", "KY;" → "KY".
|
||||
func cmdPrefix(cmd string) string {
|
||||
|
||||
Reference in New Issue
Block a user