requestConnectionPriority
suspend fun requestConnectionPriority(priority: ConnectionPriority, timeout: Duration = 3.seconds): ConnectionParameters
Requests new connection parameters.
Android API does not allow to set custom connection parameters. Instead, predefined connection priorities can be requested. Corresponding values for each priority are may differ between Android versions and devices.
On Android versions prior to Android 8 (Oreo) the updated connection parameters are not returned to the app, therefore the returned value will be ConnectionParameters.Unknown.
Return
The new connection parameters.
Parameters
priority
The new connection priority.
timeout
The timeout. Defaults to 3 seconds.
Throws
If the device is not connected.
If connection priority could not be requested.
If BLUETOOTH_CONNECT permission is denied.
TimeoutCancellationException
If the response has not been received within the specified timeout.