setMtu

open fun setMtu(@IntRange(from = 23, to = 517) mtu: Int): DfuServiceInitiator

Sets the Maximum Transfer Unit (MTU) value that the Secure DFU service will try to request before performing DFU. By default, value 517 will be used, which is the highest supported by Android. However, as the highest supported MTU by the Secure DFU from SDK 15 (first which supports higher MTU) is 247, the sides will agree on using MTU = 247 instead if the phone supports it (Lollipop or newer device).

The higher the MTU, the faster the data may be sent.

If you encounter problems with high MTU, you may lower the required value using this method. See: Issue 111

To disable requesting MTU, use value 0, or disableMtuRequest.

Note: Higher (that is greater then 23) MTUs are supported on Lollipop or newer Android devices, and on DFU bootloader from SDK 15 or newer (Secure DFU only).

Return

the builder

Parameters

mtu

the MTU that wil be requested, 0 to disable MTU request.