Skip to content

Commit b8c7925

Browse files
aykevldeadprogram
authored andcommitted
softdevice: add support for connection timeout on connect
This adds support for the "connection supervision timeout", basically the connection timeout while the connection is active (as opposed to while connecting).
1 parent ecf0975 commit b8c7925

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gap_nrf528xx-central.go

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ func (a *Adapter) Connect(address Address, params ConnectionParams) (Device, err
149149
slave_latency: 0, // mostly relevant to connected keyboards etc
150150
conn_sup_timeout: 200, // 2 seconds (in 10ms units), the minimum recommended by Apple
151151
}
152+
if params.Timeout != 0 {
153+
connectionParams.conn_sup_timeout = uint16(params.Timeout / 16)
154+
}
152155

153156
// Flag to the event handler that we are waiting for incoming connections.
154157
// This should be safe as long as Connect is not called concurrently. And

0 commit comments

Comments
 (0)