Skip to content

Conversation

bjorkert
Copy link
Contributor

@bjorkert bjorkert commented Oct 4, 2025

Improve BLE reconnect behavior after disconnect

What

  • On didDisconnectPeripheral, schedule reconnect after 2 seconds.
  • Cancel any outstanding connect-timeout timer.
  • Only reconnect if Central is powered on and the peripheral isn’t already .connecting/.connected.

Why

  • Some Anubis transmitters briefly stay “alive” or do a quick connection flurry after a disconnect. An immediate reconnect can keep the radio active and increase battery use. A short 2s debounce lets the transmitter finish powering down/settling, reducing churn and power draw.

@bjorkert
Copy link
Contributor Author

bjorkert commented Oct 4, 2025

Loop also does a 2 second pause before reconnecting. I am currently using this in-vivo.

Copy link
Collaborator

@codebymini codebymini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved based on code-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants