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