mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-12-06 15:54:27 +01:00
Heart rate straps, power meters and cadence sensors inherited maxAutoConnectAttempts = 0, so the connect-failure and quick-drop backoff never engaged for them. A sensor that fails deterministically during connect (e.g. an iOS "Encryption is insufficient" error that drops the link) was rediscovered and reconnected every few seconds forever. Straps are single-link hardware and on iOS all apps share one BLE link to them, so that loop kept knocking the strap off the trainer app as well. BleSensorDevice now opts into the same bounded backoff as other limited devices (3 attempts, then a cooldown with one quiet retry per round) and shows a short hint that the sensor may be in use elsewhere, pointing to pairing it directly in the trainer app or tapping Reconnect. connectDevice (rider picks the sensor again) now also clears the backoff streak and its pending cooldown timer, so a rider-initiated connect gets a full fresh budget instead of re-suppressing after one more failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>