setPreferredPhy
Set the preferred connection PHY.
PHY LE 2M or PHY Coded is supported since Android 8.0 (API level 26) or later. Other devices will continue to use the only PHY they support, that is Phy.PHY_LE_1M.
Please note that this is just a recommendation, whether the PHY change will happen depends on other applications preferences, local and remote controller capabilities. Controller can override these settings.
Return
The PHYs in use after the change.
Parameters
The preferred transmitter PHY.
The preferred receiver PHY. By default, it is the same as txPhy.
The preferred coding to use when transmitting on the LE Coded PHY.
The timeout. Defaults to 3 seconds.
Throws
If the device is not connected.
If PHY change could not be requested.
If BLUETOOTH_CONNECT permission is denied.
If the response has not been received within the specified timeout.