setMaxPacketLength
In order to send packets longer than MTU size, this library supports automatic segmentation of packets into at-most-MTU size chunks. This feature must be also supported by the target device, as it must reassembly received chunks into full SMP packet, based on the length field from the McuMgrHeader, included in the first segment.
This method sets the maximum packet length supported by the target device. By default, this is be set to MTU - 3, which means that each BLE packet will contain the full SMP packet (header + CBOR-encoded data). For devices supporting reading McuMgr parameters (nRF Connect SDK 2.0+) this value is automatically obtained after connection using params.
Keep in mind, that before Android 5 requesting higher MTU was not supported. Setting the maximum length to a greater value is required on those devices in order to upgrade the firmware, send file or send any other SMP packet that is longer than 20 bytes.
Since
1.3
Parameters
the maximum packet length.