This commit is contained in:
2026-01-15 22:19:32 +01:00
parent 130efeee83
commit 21db2addff
4 changed files with 758 additions and 60 deletions

View File

@@ -121,6 +121,9 @@ func (dm *DeviceManager) Initialize() error {
dm.config.Devices.FlexRadio.Port,
)
dm.flexRadio.SetReconnectInterval(3 * time.Second) // Retry every 3 seconds
dm.flexRadio.SetMaxReconnectDelay(30 * time.Second) // Max 30 second delay
// Set callback for immediate frequency changes (no waiting for update cycle)
dm.flexRadio.SetFrequencyChangeCallback(func(freqMHz float64) {
dm.handleFrequencyChange(freqMHz)
@@ -421,9 +424,7 @@ func (dm *DeviceManager) updateStatus() {
// Check cooldown to prevent rapid fire commands
timeSinceLastUpdate := time.Since(dm.lastFreqUpdateTime)
if timeSinceLastUpdate < dm.freqUpdateCooldown {
log.Printf("Auto-track: Cooldown active (%v remaining), skipping update", dm.freqUpdateCooldown-timeSinceLastUpdate)
} else {
if timeSinceLastUpdate > dm.freqUpdateCooldown {
log.Printf("Auto-track (%s): Frequency differs by %d kHz, updating Ultrabeam to %d kHz (direction=%d)", radioSource, freqDiff, radioFreqKhz, directionToUse)
// Send to Ultrabeam with saved or current direction