ble_att_set_preferred_mtu

int
ble_att_set_preferred_mtu(uint16_t mtu)

Description

Sets the preferred ATT MTU; the device will indicate this value in all subseqeunt ATT MTU exchanges. The ATT MTU of a connection is equal to the lower of the two peers' preferred MTU values. The ATT MTU is what dictates the maximum size of any message sent during a GATT procedure. The specified MTU must be within the following range: [23, BLE_ATT_MTU_MAX]. 23 is a minimum imposed by the Bluetooth specification; BLE_ATT_MTU_MAX is a NimBLE compile-time setting.

Parameters

ParameterDescription
mtuThe preferred ATT MTU.

Returned values

ValueCondition
0Success.
BLE_HS_EINVALThe specifeid value is not within the allowed range.