Skip to content

feat(gap): add ConnectionPriority to ConnectionParams - #471

Closed
acouvreur wants to merge 1 commit into
tinygo-org:devfrom
acouvreur:feat/connection-priority
Closed

feat(gap): add ConnectionPriority to ConnectionParams#471
acouvreur wants to merge 1 commit into
tinygo-org:devfrom
acouvreur:feat/connection-priority

Conversation

@acouvreur

@acouvreur acouvreur commented Sep 2, 2026

Copy link
Copy Markdown
Member

Closed. This work is now #472, from a branch in this repository.

Not every platform accepts the connection parameters from the Core
Specification. Some only accept a small fixed set of presets: on Windows,
BluetoothLEPreferredConnectionParameters has no public constructor, just
the static ThroughputOptimized, Balanced and PowerOptimized sets.
ConnectionPriority is the form of the request those platforms can honour.

The constants are named after the trade-off rather than the resulting
latency because the vendor enumerations disagree on a direction: Apple's
CBPeripheralManagerConnectionLatency .low and Android's
CONNECTION_PRIORITY_HIGH mean the same thing, so Low/Medium/High would be
read backwards by half of the audience. It also keeps "connection latency"
free for the numeric parameter the Core Specification uses it for, which is
the number of connection events a peripheral may skip.

The zero value means "leave the connection unchanged", matching the other
ConnectionParams fields. No backend reads Priority yet; wiring up the
platforms that can honour it follows separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@acouvreur

acouvreur commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

I opened this again as #472, from a branch in this repository. A PR that is on top of this one cannot use a branch in my fork as its base. The content is the same.

@acouvreur acouvreur closed this Sep 2, 2026
@acouvreur
acouvreur deleted the feat/connection-priority branch September 2, 2026 18:59
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.

1 participant