requestMtu method

Future<int> requestMtu(
  1. int mtu, {
  2. String? transactionId,
})

Requests new MTU value for current connection and return the negotiation result on Android, reads MTU on iOS.

This function currently is not doing anything on iOS platform as MTU is requested automatically around 186.

Peripheral will negotiate requested mtu, meaning it might be actually lower than the requested size. Optional transactionId could be used to cancel operation.

If MTU has been requested in connect() this method will end with BleError.

Implementation

Future<int> requestMtu(int mtu, {String? transactionId}) =>
    _manager.requestMtu(
        this, mtu, transactionId ?? TransactionIdGenerator.getNextId());