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
Parameter | Description |
---|---|
[in] preferredMtuCentral | Preferred ATT MTU when GAP role is central. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully configured preferred MTU in GATT Client role. |
MBA_RES_INVALID_PARA | Invalid MTU value usage. |