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).
This commit is contained in:
Ayke van Laethem 2024-01-05 16:54:42 +01:00 committed by Ron Evans
parent ecf09759ac
commit b8c79250c7

View file

@ -149,6 +149,9 @@ func (a *Adapter) Connect(address Address, params ConnectionParams) (Device, err
slave_latency: 0, // mostly relevant to connected keyboards etc
conn_sup_timeout: 200, // 2 seconds (in 10ms units), the minimum recommended by Apple
}
if params.Timeout != 0 {
connectionParams.conn_sup_timeout = uint16(params.Timeout / 16)
}
// Flag to the event handler that we are waiting for incoming connections.
// This should be safe as long as Connect is not called concurrently. And