feat: remote_call UDP accepts <FREQ>/<MODE> from DXHunter and tunes the active CAT backend

This commit is contained in:
2026-07-29 17:49:29 +02:00
parent ccceab9d02
commit a036120871
2 changed files with 54 additions and 5 deletions
+18 -3
View File
@@ -10844,9 +10844,24 @@ func (a *App) consumeUDPEvents() {
"service": string(ev.Service),
"source": ev.Source,
})
case ev.DXCall != "" && ev.Service == udp.ServiceRemoteCall:
applog.Printf("udp: emit udp:remote_call %q\n", ev.DXCall)
wruntime.EventsEmit(a.ctx, "udp:remote_call", ev.DXCall)
case (ev.DXCall != "" || ev.TuneFreqHz > 0) && ev.Service == udp.ServiceRemoteCall:
// CAT tune riding along with the callsign (DXHunter spot click:
// "<CALLSIGN>VP5G<FREQ>10.136<MODE>FT8"). Freq first so the rig is
// already moving while the frontend fills the entry field.
if ev.TuneFreqHz > 0 {
applog.Printf("udp: remote_call tune request %.3f MHz mode=%q\n", float64(ev.TuneFreqHz)/1e6, ev.TuneMode)
if err := a.SetCATFrequency(ev.TuneFreqHz); err != nil {
applog.Printf("udp: remote_call tune failed: %v\n", err)
} else if ev.TuneMode != "" {
if err := a.SetCATMode(ev.TuneMode); err != nil {
applog.Printf("udp: remote_call mode set failed: %v\n", err)
}
}
}
if ev.DXCall != "" {
applog.Printf("udp: emit udp:remote_call %q\n", ev.DXCall)
wruntime.EventsEmit(a.ctx, "udp:remote_call", ev.DXCall)
}
case ev.DXCall != "":
applog.Printf("udp: emit udp:dx_call %q (mode=%s freq=%d)\n", ev.DXCall, ev.Mode, ev.FreqHz)
wruntime.EventsEmit(a.ctx, "udp:dx_call", map[string]any{