GATTC_SetPreferredMtu

C

uint16_t GATTC_SetPreferredMtu(uint16_t preferredMtuCentral);

Description

GATT Client allow user to configure preferred ATT MTU as GATT Client.

When connection established with remote peer, GATT client will initiate MTU negotiation with remote peer. By default, BLE_ATT_MAX_MTU_LEN will be used to negotiate with remote. If user sets preferred MTU, the set value will be used to negotiate with remote.

Note

The API is optional. If preferred MTU is not set, BLE_ATT_MAX_MTU_LEN will be used.

Only preferred MTU setting provided in GAP central role. In GAP peripheral role, remote central will initiate MTU negotiation in most of the time.

The setting won't be applied to the current connections. GATTC_ExchangeMTURequest for MTU exchange in connected state.

Parameters

ParameterDescription
[in] preferredMtuCentralPreferred ATT MTU when GAP role is central.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully configured preferred MTU in GATT Client role.
MBA_RES_INVALID_PARAInvalid MTU value usage.