requestHighestValueLength
Requests the highest possible MTU (517).
The highest MTU will be automatically requested when the peripheral is reconnected when connected using automaticallyRequestHighestValueLength option.
Note
Although it used to be possible to request any value of MTU from 23 to 517, since Android 14 the system will always request value 517 ignoring the requested value. Hence, this method does not allow to set custom MTU value.
Important
It is known that some Android devices (i.e. Samsung Galaxy Tab A8) fail to negotiate L2CAP MTU (packet size on the Link Layer) using Data Length Extension (DLE). They mistakenly claim supporting only 27 bytes of TX, but then try to send up to 251 bytes, causing the connection to terminate. For such devices it is recommended not to request higher MTU or never sending more than 20 bytes in a single write operation.
Throws
If the device is not connected.
If MTU could not be requested.
If BLUETOOTH_CONNECT permission is denied.