fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user