Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions gap.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,19 @@ func (buf *rawAdvertisementPayload) addServiceUUID(uuid UUID) (ok bool) {
}
}

type ConnectionLatency uint8

const (
// A latency setting that uses the default connection parameters of the system.
ConnectionLatencyDefault ConnectionLatency = 0
// A latency setting indicating that prioritizes rapid communication over battery life.
ConnectionLatencyLow ConnectionLatency = 1
// A latency setting that balances communication frequency and battery life.
ConnectionLatencyMedium ConnectionLatency = 2
// A latency setting that prioritizes extending battery life over rapid communication.
ConnectionLatencyHigh ConnectionLatency = 3
)

// ConnectionParams are used when connecting to a peripherals or when changing
// the parameters of an active connection.
type ConnectionParams struct {
Expand All @@ -604,4 +617,14 @@ type ConnectionParams struct {
// communication, the connection is considered lost. If no timeout is
// specified, the timeout will be unchanged.
Timeout Duration

// Latency setting. This is a high-level setting that indicates whether the connection should
// prioritize rapid communication or battery life.
//
// Some platforms (e.g. Windows) may not support setting the connection parameters directly,
// but may support setting a latency level that corresponds to a set of connection parameters.
// In this case, the Latency field can be used to set the latency level instead of setting the connection parameters directly.
//
// If no latency is specified, the latency will be unchanged.
Latency ConnectionLatency
}
Loading