feat(tci): key CW through the radio's own macro keyer

The sixth CW engine, and the one the TCI backend was left without. A SunSDR
keys from the WebSocket that already carries the CAT: no WinKeyer, no second
serial port, nothing to wire.

    CW_MACROS:0,<text>;     send
    CW_MACROS_SPEED:<wpm>;  speed
    CW_MACROS_STOP;         abort

Confirmed against the TCI command table in ars-ka0s/eesdr-tci — the source that
settled SPOT. CW_MACROS rather than TCI 2.0's CW_MSG: it exists from 1.6, and
OpsLog resolves its own variables, so the before/after callsign fields have
nothing to carry.

Commas and semicolons are stripped before sending. They are the protocol's own
separators: a comma would become another argument, a semicolon would end the
command with the message half keyed and the rest parsed as a command.

Only the MACRO speed is set, not the paddle keyer's — an operator who set their
paddle to 28 wpm did not ask for it to change because a macro went out at 25.
And there is no backspace: TCI can stop a message but cannot un-type one, so the
type-ahead correction the Flex engine offers is absent rather than faked.
This commit is contained in:
2026-08-28 13:01:55 +02:00
parent 8bc4ed68d4
commit 766b0f95a4
11 changed files with 200 additions and 10 deletions
+30
View File
@@ -14619,6 +14619,36 @@ func (a *App) FlexBackspaceCW(n int) error {
return a.cat.FlexDo(func(fc cat.FlexController) error { return fc.BackspaceCW(n) })
}
// TCISendCW keys a CW message through the SunSDR's own macro keyer, so a TCI
// station needs no WinKeyer and no second serial port. Text is already
// variable-resolved by the UI.
func (a *App) TCISendCW(text string) error {
if a.cat == nil {
return fmt.Errorf("cat not initialized")
}
err := a.cat.TCICWDo(func(tc cat.TCICWController) error { return tc.SendCW(text) })
if err != nil {
applog.Printf("tci cw: TCISendCW(%q) failed: %v", text, err)
}
return err
}
// TCIStopCW aborts whatever the keyer is sending.
func (a *App) TCIStopCW() error {
if a.cat == nil {
return fmt.Errorf("cat not initialized")
}
return a.cat.TCICWDo(func(tc cat.TCICWController) error { return tc.StopCW() })
}
// TCISetKeySpeed sets the macro keyer speed in WPM.
func (a *App) TCISetKeySpeed(wpm int) error {
if a.cat == nil {
return fmt.Errorf("cat not initialized")
}
return a.cat.TCICWDo(func(tc cat.TCICWController) error { return tc.SetCWSpeed(wpm) })
}
// IcomStopCW aborts the CW message currently being sent.
func (a *App) IcomStopCW() error {
if a.cat == nil {