is there any way to change the MTU value on iOS from the default to an arbitrary value?
Much like in Android it's possible to do requestMTU(512).
Thanks
No, MTU on iOS is set automatically, maximum value is 185. This is a good answer to your question: https://stackoverflow.com/a/42336001/10380092
Note: you can get MTU value this way (it will be 3 bytes less than the ATT MTU):
connectedPeripheral.maximumWriteValueLength(for: .withoutResponse)
It's important to use parameter .withoutResponse
, because .withResponse
will always return 512 (when writing with response, iOS automatically chooses the approach: single write if data is shorter than MTU, or queued write if data is larger than MTU).