This commit is contained in:
2026-06-13 17:25:48 +02:00
parent d3ba7c71f4
commit 0b3e22c97e
5 changed files with 39 additions and 43 deletions
+10
View File
@@ -6320,6 +6320,16 @@ func (a *App) SetUltrabeamDirection(direction int) error {
if direction < 0 || direction > 2 {
return fmt.Errorf("invalid direction %d", direction)
}
// The device has no standalone direction command: it re-issues the current
// frequency with the new direction byte. If the antenna hasn't reported a
// frequency yet (just connected / remote link still settling), fall back to
// the rig's current CAT frequency so the control still works.
st, _ := a.ultrabeam.GetStatus()
if (st == nil || st.Frequency <= 0) && a.cat != nil {
if rs := a.cat.State(); rs.Connected && rs.FreqHz > 0 {
return a.ultrabeam.SetFrequency(int(rs.FreqHz/1000), direction)
}
}
return a.ultrabeam.SetDirection(direction)
}